Skip to content
a extremely high performance log library for android. 高性能的Android日志库
Java Groovy
Branch: master
Clone or download
Latest commit 9b99aba Jun 27, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
clue-plugin local debug configuration Mar 10, 2017
clue-sample fix duplicate file name Jun 27, 2017
clue relayout project Mar 13, 2017
.gitignore add implementation Mar 6, 2017 rm annotation Mar 31, 2017 rm annotation Mar 31, 2017
build.gradle add doc and library publish script Mar 11, 2017
clue.png replace image Mar 29, 2017 init repo Feb 24, 2017
settings.gradle relayout project Mar 13, 2017



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.


  • 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


1 include plugin in top level build.gradle file.

buildscript {
  repositories {
    maven {
      url ""
  dependencies {
    classpath ""

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 {
    public void 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


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.


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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.
You can’t perform that action at this time.