All Projects → linsea → clue

linsea / clue

Licence: other
a extremely high performance log library for android. 高性能的Android日志库

Programming Languages

java
68154 projects - #9 most used programming language
groovy
2714 projects

Projects that are alternatives of or similar to clue

Easylogger
An ultra-lightweight(ROM<1.6K, RAM<0.3k), high-performance C/C++ log library. | 一款超轻量级(ROM<1.6K, RAM<0.3k)、高性能的 C/C++ 日志库
Stars: ✭ 1,968 (+7188.89%)
Mutual labels:  log, high-performance, logger
Golog
A high-performant Logging Foundation for Go Applications. X3 faster than the rest leveled loggers.
Stars: ✭ 208 (+670.37%)
Mutual labels:  log, high-performance, logger
l
Cross-platform html/io [L]ogger with simple API.
Stars: ✭ 26 (-3.7%)
Mutual labels:  log, logger, logging-library
JJSwiftLog
Swift log library for all platform
Stars: ✭ 51 (+88.89%)
Mutual labels:  log, logger, logging-library
Cocoadebug
iOS Debugging Tool 🚀
Stars: ✭ 3,769 (+13859.26%)
Mutual labels:  log, logger, logging-library
LogDNA-Android-Client
Android client for LogDNA
Stars: ✭ 22 (-18.52%)
Mutual labels:  log, logger, logging-library
Lajax
🚀 lajax - 前端日志解决方案。
Stars: ✭ 181 (+570.37%)
Mutual labels:  log, logger
Logger
✔️ Simple, pretty and powerful logger for android
Stars: ✭ 13,093 (+48392.59%)
Mutual labels:  log, logger
ULog
Unified cross-platform logging framework for C, C++, Objective-C, Swift, ASL and C#.
Stars: ✭ 13 (-51.85%)
Mutual labels:  log, logging-library
Logcat
Android 日志打印框架,在手机上可以直接看到 Logcat 日志啦
Stars: ✭ 189 (+600%)
Mutual labels:  log, logger
Xlog
Android logger, pretty, powerful and flexible, log to everywhere, save to file, all you want is here.
Stars: ✭ 2,468 (+9040.74%)
Mutual labels:  log, logger
Monolog Bundle
Symfony Monolog Bundle
Stars: ✭ 2,532 (+9277.78%)
Mutual labels:  log, logger
Easy Log Handler
Human-friendly log files that make you more productive
Stars: ✭ 2,070 (+7566.67%)
Mutual labels:  log, logger
Heliumlogger
A lightweight logging framework for Swift
Stars: ✭ 169 (+525.93%)
Mutual labels:  log, logger
Acho
The Hackable Log
Stars: ✭ 189 (+600%)
Mutual labels:  log, logger
Gol
gol is a high performance async log kit for golang
Stars: ✭ 166 (+514.81%)
Mutual labels:  log, high-performance
Go Logger
一个简单而强大的 golang 日志工具包,支持同步和异步输出到 命令行,文件, api 接口,文件支持按文件大小,文件行数,日期切分;A simple and powerful golang logging toolkit that supports synchronous and asynchronous output to the console, file, API interfaces, file support by file size, file line number, date sharding.
Stars: ✭ 152 (+462.96%)
Mutual labels:  log, logger
ng-logger
Angular logger service
Stars: ✭ 65 (+140.74%)
Mutual labels:  log, logger
log
Aplus Framework Log Library
Stars: ✭ 14 (-48.15%)
Mutual labels:  log, logger
sprout
Golang logging library supporting log retrieval.
Stars: ✭ 85 (+214.81%)
Mutual labels:  log, logger

中文版说明

clue

a extremely high-performance logger for android

Why High-Performance

In common logger library, in order to get caller class name(for TAG usage), method name and source line number, they make use of below APIs:

StackTraceElement[] stacks = Thread.currentThread().getStackTrace(); //expensive cost
StackTraceElement element = stacks[4];
int lineNumber = element.getLineNumber();
String fileName = element.getFileName()

which cost is extremely expensive, and should never happen in production.

It is obviously when source code is finished and ready to compile, the class name, method name and source line number is fixed and never change, should not dynamically be obtained at runtime to degrade application performances.

clue don't call this expensive cost API, it leverages bytecode manipulate power to get these information at compile time to speed up the application performances, this is especially valuable in the scenario which would write logs, but want not degrade the performance of the APP, or for the APPs which pursuit of extreme performance.

Features

  • Class name tag(default) or custom tag
  • Caller method name
  • Source line number information
  • Thread name information
  • Link to source in IDE
  • High performance to intercept above information
  • Extensible API

Usage

1 include plugin in top level build.gradle file.

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.com.github.linsea:clue-plugin:1.0.0"
  }
}

2 apply plugin to project build.gradle

apply plugin: "com.github.linsea.clue-plugin"

3 add library dependency to project build.gradle file.

compile 'com.linsea:clue:1.0'

4 add a log receiver in the Application class

public class MyApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        Clue.addLog(new ConsoleLog()); //init Clue log with default logcat
    }
}

5 call Clue's static methods, e.g.

public static void v(String message, Object... args);

public static void vt(String tag, String message, Object... args)

public static void v(Throwable t, String message, Object... args)

public static void vt(String tag, Throwable t, String message, Object... args)

see sample application in clue/clue-sample

Extension

You are able to add your own logger implementation to Clue (e.g. a logger to write logs to files), which only needs to extends BaseLog and call Clue.add(...) to add to Clue, more details references ConsoleLog implementation.

License

Copyright 2017 clue author

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].