Skip to content

基于阿里云 PutWebtracking 封装的日志上传 Android library

License

Notifications You must be signed in to change notification settings

davistsin/aliyun-webtracking-android

Repository files navigation

aliyun-webtracking-android

license

安装

Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Add the dependency

implementation 'com.github.davistsin:aliyun-webtracking-android:{last version}'

使用

初始化

Logger.init(this, "your project name", "cn-shenzhen", "Your logstore name",
        new LoggerConfig.Builder()
                .enablePrint(true)
                .setOfflineMode(true)
                .setMaxOfflineNum(100)
                .build()
);

调用

上传Json文本

JSONObject object = new JSONObject();
object.put("test", "123456789000");
Logger.put(object.toString());

上传普通日志,已自动包含设备信息

Logger.log("TAG", "上报一个错误");

设置应用信息

Logger.setAppInfo("appName", BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE);

About

基于阿里云 PutWebtracking 封装的日志上传 Android library

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages