当前位置: 首页>>代码示例>>Java>>正文


Java AndroidLogAdapter类代码示例

本文整理汇总了Java中com.orhanobut.logger.AndroidLogAdapter的典型用法代码示例。如果您正苦于以下问题:Java AndroidLogAdapter类的具体用法?Java AndroidLogAdapter怎么用?Java AndroidLogAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AndroidLogAdapter类属于com.orhanobut.logger包,在下文中一共展示了AndroidLogAdapter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import com.orhanobut.logger.AndroidLogAdapter; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();

    MultiDex.install(this);

    Logger.addLogAdapter(new AndroidLogAdapter() {
        @Override
        public boolean isLoggable(int priority, String tag) {
            return BuildConfig.DEBUG;
        }
    });

    Hawk.init(getBaseContext()).build();

    CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
            .setDefaultFontPath("fonts/lato_regular.ttf")
            .setFontAttrId(R.attr.fontPath)
            .build()
    );
}
 
开发者ID:mayuroks,项目名称:Coin-Tracker,代码行数:22,代码来源:BaseApplication.java

示例2: onCreate

import com.orhanobut.logger.AndroidLogAdapter; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    //初始化Logger
    Logger.addLogAdapter(new AndroidLogAdapter());
    //控制日志输出
    LogUtil.LEVEL = LogUtil.VERBOSE;
    context = getApplicationContext();
    //初始化栈视图功能
    Fragmentation.builder()
            .stackViewMode(Fragmentation.BUBBLE)
            .debug(BuildConfig.DEBUG)
            .handleException(new ExceptionHandler() {
                @Override
                public void onException(Exception e) {
                    //处理异常
                }
            })
            .install();
    //AndroidUtilCode初始化
    Utils.init(this);

}
 
开发者ID:organizationAllink,项目名称:wzyx-android-user,代码行数:24,代码来源:WzyxApplication.java

示例3: onCreate

import com.orhanobut.logger.AndroidLogAdapter; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    CrashReport.initCrashReport(getApplicationContext(), "e1a62089c6", false);
    ImagePipelineConfig config = ImagePipelineConfig.newBuilder(this)
            .setProgressiveJpegConfig(new SimpleProgressiveJpegConfig())
            .build();
    Fresco.initialize(this, config);
    SDKInitializer.initialize(this);
    Bmob.initialize(this, "b0cb494256d9b86fc931ca930a055b75");
    Logger.addLogAdapter(new AndroidLogAdapter(){
        @Override
        public boolean isLoggable(int priority, String tag) {
            return true;// TODO: 2017/6/5
        }
    });
    sInstance = this;
    initUser();
}
 
开发者ID:yiwent,项目名称:Mobike,代码行数:20,代码来源:MyApplication.java

示例4: onCreate

import com.orhanobut.logger.AndroidLogAdapter; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    instances = this;
    //greendao
    mAppComponent = DaggerAppComponent
            .builder()
            .appModule(new AppModule(this))
            .build();
    setDatabase();
    //logger
    if(LogUtils.isApkDebugable(this)) {
        Logger.addLogAdapter(new AndroidLogAdapter());
    }
    //umeng analytics
    MobclickAgent.setScenarioType(this, MobclickAgent.EScenarioType.E_UM_NORMAL);
    SkinCompatManager.withoutActivity(this)                         // 基础控件换肤初始化
            .addInflater(new SkinMaterialViewInflater())            // material design 控件换肤初始化[可选]
            .setSkinStatusBarColorEnable(false)                     // 关闭状态栏换肤,默认打开[可选]
            .setSkinWindowBackgroundEnable(false)                   // 关闭windowBackground换肤,默认打开[可选]
            .loadSkin();
}
 
开发者ID:zyl409214686,项目名称:Mp3Cutter,代码行数:23,代码来源:MyApplication.java

示例5: onCreate

import com.orhanobut.logger.AndroidLogAdapter; //导入依赖的package包/类
@Override
    public void onCreate() {
        super.onCreate();
        mcontext = this;
        new Thread(new Runnable() {
            @Override
            public void run() {
                NetService.getInstance().init(cityUrl);
                Logger.addLogAdapter(new AndroidLogAdapter());
            }
        }).start();

//        Stetho.initializeWithDefaults(this);
//        mRefWatcher = LeakCanary.install(mcontext);
        TimeMonitorManager.getInstance().getTimeMonitor(TimeMonitorConfig
                .TIME_MONITOR_ID_APPLICATION_START).recordingTimeTag("ApplicationCreated");

//        DaoMaster.DevOpenHelper helper = new DaoMaster.DevOpenHelper(getAppContext(),
//                "weather-db", null);
//        daoMaster = new DaoMaster(helper.getWritableDatabase());


//        CrashHandler crashHandler = CrashHandler.getInstance();
//        crashHandler.init(this);
//        crashHandler.sendPreviousReportsToServer();
    }
 
开发者ID:byhieg,项目名称:easyweather,代码行数:27,代码来源:MyApplication.java

示例6: onCreate

import com.orhanobut.logger.AndroidLogAdapter; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();

    Logger.addLogAdapter(new AndroidLogAdapter());

    if (PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).
            getBoolean(getString(R.string.key_pref_logging), false)) {
        if (ContextCompat.checkSelfPermission(getApplicationContext(),
                Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
            Logger.addLogAdapter(new DiskLogAdapter());
        } else {
            PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit()
                    .putBoolean(getString(R.string.key_pref_logging), false)
                    .apply();
        }
    }

    Logger.log(Logger.ASSERT, null, "======Easer started======", null);
}
 
开发者ID:renyuneyun,项目名称:Easer,代码行数:21,代码来源:EaserApplication.java

示例7: configure

import com.orhanobut.logger.AndroidLogAdapter; //导入依赖的package包/类
public final void configure() {
    //初始化OkHttpClient
    if (HH_CONFIGS.get(ConfigKeys.OKHTTP_CLIENT) == null) {
        //添加interceptor
        for (Interceptor interceptor : INTERCEPTORS) {
            BUILDER.addInterceptor(interceptor);
        }
        HH_CONFIGS.put(ConfigKeys.OKHTTP_CLIENT, BUILDER.build());
    }
    //初始化Utils库
    Utils.init((Application) HHEngine.getApplicationContext());
    //初始化icon库
    initIcons();
    //初始化logger库
    Logger.addLogAdapter(new AndroidLogAdapter());
    HH_CONFIGS.put(ConfigKeys.CONFIG_READY, true);
}
 
开发者ID:huxizhijian,项目名称:HHComicViewer,代码行数:18,代码来源:Configurator.java

示例8: initBase

import com.orhanobut.logger.AndroidLogAdapter; //导入依赖的package包/类
public static void initBase(Application application) {
    instance = application;
    handler = new Handler();
    FormatStrategy formatStrategy = PrettyFormatStrategy.newBuilder()
            .showThreadInfo(false)  // (Optional) Whether to show thread info or not. Default true
            .methodCount(0)         // (Optional) How many method line to show. Default 2
            .methodOffset(7)        // (Optional) Hides internal method calls up to offset. Default 5
            .build();
    Logger.addLogAdapter(new AndroidLogAdapter(formatStrategy));
}
 
开发者ID:DoomsDayXx,项目名称:BaseDevelopment,代码行数:11,代码来源:Base.java

示例9: init

import com.orhanobut.logger.AndroidLogAdapter; //导入依赖的package包/类
public void init(Context context) {
    Cache cache = new Cache(context.getCacheDir(), 10 * 1024 * 1024);
    HttpLoggingInterceptor.Logger logger = new  HttpLoggingInterceptor.Logger() {
        @Override
        public void log(String message) {
            if (message.startsWith("{") || message.startsWith("[")) {
                Logger.json(message);
            } else {
                Log.d("okhttp", "" + message);
            }
        }
    };
    Logger.addLogAdapter(new AndroidLogAdapter());
    HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor(logger);
    loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
    okHttpClient = new OkHttpClient.Builder()
            .addInterceptor(new OAuth1SigningInterceptor())
            .addInterceptor(loggingInterceptor)
            .cache(cache)
            .readTimeout(60, TimeUnit.SECONDS)
            .writeTimeout(60, TimeUnit.SECONDS)
            .build();
    Gson gson = new GsonBuilder()
            .setLenient()
            .create();

    retrofit = new Retrofit.Builder()
            .baseUrl(Constants.BASE_URL)
            .addConverterFactory(GsonConverterFactory.create(gson))
            .client(okHttpClient)
            .build();
}
 
开发者ID:mingdroid,项目名称:tumbviewer,代码行数:33,代码来源:RestClient.java

示例10: MyLogger

import com.orhanobut.logger.AndroidLogAdapter; //导入依赖的package包/类
public MyLogger(@Level int i) {
    LEVEL = i;
    if (LEVEL != NOTHING) {
        Logger.addLogAdapter(new AndroidLogAdapter());
    }
    if (LEVEL == ERROR) {
        Logger.addLogAdapter(new DiskLogAdapter());
    }
}
 
开发者ID:QuincySx,项目名称:AvenueNet,代码行数:10,代码来源:MyLogger.java

示例11: onCreate

import com.orhanobut.logger.AndroidLogAdapter; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    /**
     * 初始化日志工具
     */
    Logger.addLogAdapter(new AndroidLogAdapter());
    //TODO 集成:1.4、初始化数据服务SDK、保存设备信息并启动推送服务
    /**
     * 初始化比目数据SDK
     */
    Bmob.initialize(this, "e9b559bd68461777602a46dead1b581b");
    /**
     * 保存设备信息,用于推送功能
     */
    BmobInstallationManager.getInstance().initialize(new InstallationListener<BmobInstallation>() {
        @Override
        public void done(BmobInstallation bmobInstallation, BmobException e) {
            if (e == null) {
                Logger.i(bmobInstallation.getObjectId() + "-" + bmobInstallation.getInstallationId());
            } else {
                Logger.e(e.getMessage());
            }
        }
    });
    /**
     * 启动推送服务
     */
    BmobPush.startWork(this);
}
 
开发者ID:chaozhouzhang,项目名称:bmob-push-demo,代码行数:31,代码来源:App.java

示例12: LoggerLog

import com.orhanobut.logger.AndroidLogAdapter; //导入依赖的package包/类
public LoggerLog() {
        FormatStrategy formatStrategy = PrettyFormatStrategy.newBuilder()
                .showThreadInfo(true)  // (Optional) Whether to show thread info or not. Default true
                .methodCount(2)         // (Optional) How many method line to show. Default 2
                .methodOffset(2)        // (Optional) Hides internal method calls up to offset. Default 5
//                .logStrategy(customLog) // (Optional) Changes the log strategy to print out. Default LogCat
//                .tag("My custom tag")   // (Optional) Global tag for every log. Default PRETTY_LOGGER
                .build();
        Logger.addLogAdapter(new AndroidLogAdapter(formatStrategy));
    }
 
开发者ID:zillachan,项目名称:AndLog,代码行数:11,代码来源:LoggerLog.java

示例13: onCreate

import com.orhanobut.logger.AndroidLogAdapter; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    mApplication = this;
    mContext = getApplicationContext();
    init();
    UMShareAPI.get(this);
    Logger.addLogAdapter(new AndroidLogAdapter());
    Logger.addLogAdapter(new DiskLogAdapter());
}
 
开发者ID:yzbzz,项目名称:beautifullife,代码行数:11,代码来源:App.java

示例14: configure

import com.orhanobut.logger.AndroidLogAdapter; //导入依赖的package包/类
public final void configure() {

        Logger.addLogAdapter(new AndroidLogAdapter());
        LATTE_CONFIGS.put(ConfigKeys.CONFIG_READY, true);
        Utils.init(Bing.getApplicationContext());
    }
 
开发者ID:wang2016215,项目名称:Bing,代码行数:7,代码来源:Configurator.java

示例15: onCreate

import com.orhanobut.logger.AndroidLogAdapter; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    Logger.addLogAdapter(new AndroidLogAdapter());
}
 
开发者ID:BittleDragon,项目名称:MyRepository,代码行数:6,代码来源:CustomPBApplication.java


注:本文中的com.orhanobut.logger.AndroidLogAdapter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。