标签:
Galgo是Android日志类库,用于在屏幕上显示应用的日志信息。这对于测试人员和开发人员非常有用,可以根据屏幕上的日志文件了解应用出现BUG时发生的事情。
可以定义屏幕上显示日志的背景颜色、文本颜色、文本大小和日志显示的行数。
https://github.com/inaka/galgo
public class ExampleActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_example);
// add some customization to the log messages
GalgoOptions options = new GalgoOptions.Builder()
.numberOfLines(15)
.backgroundColor(Color.parseColor("#D9d6d6d6"))
.textColor(Color.BLACK)
.textSize(15)
.build();
Galgo.enable(this, options);
Galgo.log("I am a log message");
}
public void onDestroy() {
super.onDestroy();
// always call disable to avoid memory leaks
Galgo.disable(this);
}
}
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.inaka.galgo">
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<application android:allowBackup="true" android:label="@string/app_name">
<service android:name=".GalgoService" />
</application>
</manifest>
https://github.com/jgilfelt/GhostLog
标签:
原文地址:http://my.oschina.net/sfshine/blog/523719