/** * 在application调用初始化 */ public static void logInit(boolean debug) { DEBUG_ENABLE=debug; if (DEBUG_ENABLE) { Logger.init(AppConfig.DEBUG_TAG) // default PRETTYLOGGER or use just init() .methodCount(2) // default 2 .logLevel(LogLevel.FULL) // default LogLevel.FULL .methodOffset(0); // default 0 } else { Logger.init() // default PRETTYLOGGER or use just init() .methodCount(3) // default 2 .hideThreadInfo() // default shown .logLevel(LogLevel.NONE) // default LogLevel.FULL .methodOffset(2); } } public static void logd(String tag,String message) {
@Override public void onCreate() { super.onCreate(); context = getApplicationContext(); Logger.init("hhh") .methodOffset(2) .methodCount(2) .hideThreadInfo() .logLevel(BuildConfig.DEBUG ? LogLevel.FULL : LogLevel.NONE); }
public static void init(Context context) { Context applicationContext = context.getApplicationContext(); if (applicationContext.getExternalCacheDir() != null && isExistSDCard()) { cacheDir = applicationContext.getExternalCacheDir().toString(); } else { cacheDir = applicationContext.getCacheDir().toString(); } PATH = cacheDir + "/Log"; Logger.init(TAG) // default PRETTYLOGGER or use just init() .methodCount(3) // default 2 .hideThreadInfo(); /* Logger.init(TAG) // default PRETTYLOGGER or use just init() .methodCount(3) // default 2 .hideThreadInfo() // default shown .logLevel(LogLevel.FULL) // default LogLevel.FULL .methodOffset(2); // default 0*/ }
public static synchronized void init(boolean debug, String tag) { sDebug = debug; if (debug) { Logger.init(tag).hideThreadInfo().methodCount(0); } }
/** * 初始化log工具,在app入口处调用 * * @param isLogEnable 是否打印log */ public static void init(boolean isLogEnable) { Logger.init("LogHttpInfo") .hideThreadInfo() .logLevel(isLogEnable ? LogLevel.FULL : LogLevel.NONE) .methodOffset(2); }
@Override public void onCreate() { super.onCreate(); com.wanjian.sak.LayoutManager.init(this); Logger .init("MainApplication") // default PRETTYLOGGER or use just init() .methodCount(1) // default 2 .hideThreadInfo() // default shown .logLevel(LogLevel.FULL) // default LogLevel.FULL .methodOffset(2) // default 0 ; //default AndroidLogAdapter } }
@Override public void onCreate() { super.onCreate(); instance = this; Bmob.initialize(this, ApplicationID); //初始化Log系统 Logger.init("MyDemo") // default PRETTYLOGGER or use just init() .setMethodCount(1) // default 2 .hideThreadInfo(); // default shown //异常捕获收集 // CrashWoodpecker.fly().to(this); }
/** * 日志打印参数配置 * @param tag 日志标示,可以为空 * @param methodCount 显示方法行数,默认为:2 * @param isHideThreadInfo 是否显示线程信息,默认显示 * @param adapter 自定义log输出 * @param isDebug true:打印全部日志,false:不打印日志 * @return */ public BasicConfig initLog(String tag,Integer methodCount, boolean isHideThreadInfo, LogAdapter adapter, boolean isDebug){ Settings settings = Logger.init(TextUtils.isEmpty(tag) ? LOG_TAG : tag); if(null != methodCount){ settings.methodCount(methodCount); } if(isHideThreadInfo){ settings.hideThreadInfo(); } if(null != adapter){ settings.logAdapter(adapter); } settings.logLevel(isDebug ? LogLevel.FULL : LogLevel.NONE); return this; } }
@Override public void onCreate() { super.onCreate(); baseApplication = this; if (CommonUtils.isMainProcess(this)) { store = new Stack<>(); registerActivityLifecycleCallbacks(new SwitchBackgroundCallbacks()); //utils Utils.init(this); //log Logger .init(AppUtils.getAppName(this)) .methodCount(0) .hideThreadInfo() .logLevel(isDebug() ? LogLevel.FULL : LogLevel.NONE) .methodOffset(0); onMainProcessCreate(); } }
/** * 在application调用初始化 */ public static void logInit(boolean debug) { DEBUG_ENABLE=debug; if (DEBUG_ENABLE) { Logger.init(AppConfig.DEBUG_TAG) // default PRETTYLOGGER or use just init() .methodCount(2) // default 2 .logLevel(LogLevel.FULL) // default LogLevel.FULL .methodOffset(0); // default 0 } else { Logger.init() // default PRETTYLOGGER or use just init() .methodCount(3) // default 2 .hideThreadInfo() // default shown .logLevel(LogLevel.NONE) // default LogLevel.FULL .methodOffset(2); } } public static void logd(String tag, String message) {
/** * 在application调用初始化 */ public static void logInit(boolean debug) { DEBUG_ENABLE=debug; if (DEBUG_ENABLE) { Logger.init(AppConfig.DEBUG_TAG) // default PRETTYLOGGER or use just init() .methodCount(2) // default 2 .logLevel(LogLevel.FULL) // default LogLevel.FULL .methodOffset(0); // default 0 } else { Logger.init() // default PRETTYLOGGER or use just init() .methodCount(3) // default 2 .hideThreadInfo() // default shown .logLevel(LogLevel.NONE) // default LogLevel.FULL .methodOffset(2); } } public static void logd(String tag,String message) {