本文整理了Java中com.orhanobut.logger.Logger.w()
方法的一些代码示例,展示了Logger.w()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.w()
方法的具体详情如下:
包路径:com.orhanobut.logger.Logger
类名称:Logger
方法名:w
[英]Tip: Use this for exceptional situations to log ie: Unexpected errors etc
[中]提示:在异常情况下使用此选项记录ie:意外错误等
代码示例来源:origin: Rukey7/MvpApp
@Override
public void onNext(NewsTypeInfo newsTypeBean) {
Logger.w(newsTypeBean.toString());
}
});
代码示例来源:origin: Rukey7/MvpApp
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
if (key.equals(NO_IMAGE_KEY)) {
Logger.w(sharedPreferences.getBoolean(NO_IMAGE_KEY, false)+"");
} else if (key.equals(SAVE_PATH_KEY)) {
String path = sharedPreferences.getString(SAVE_PATH_KEY, "/sdcard");
mFilePickerPreference.setSummary(path);
}
}
代码示例来源:origin: Rukey7/MvpApp
private void init(InputStream in) throws JSONException {
if(in == null)
throw new NullPointerException("input stream cannot be null!");
mInput = in;
Logger.e("init");
String json = IOUtils.getString(mInput);
Logger.w(json);
init(json);
}
代码示例来源:origin: Rukey7/MvpApp
@Override
public boolean urlClicked(String url) {
Logger.e(url);
String newsId = NewsUtils.clipNewsIdFromUrl(url);
Logger.w(url);
if (newsId != null) {
launch(NewsDetailActivity.this, newsId);
}
return true;
}
})
代码示例来源:origin: Rukey7/MvpApp
@Override
public Response intercept(Chain chain) throws IOException {
final Request request = chain.request();
Buffer requestBuffer = new Buffer();
if (request.body() != null) {
request.body().writeTo(requestBuffer);
} else {
Logger.d("LogTAG", "request.body() == null");
}
//打印url信息
Logger.w(request.url() + (request.body() != null ? "?" + _parseParams(request.body(), requestBuffer) : ""));
final Response response = chain.proceed(request);
return response;
}
};
代码示例来源:origin: Rukey7/MvpApp
@Override
public void onDataObtain(DanmakuInfo danmakuInfo) {
Logger.w(danmakuInfo.toString());
danmakuInfo.setUserName("Long");
danmakuInfo.setVid(mVideoData.getVid());
mPresenter.addDanmaku(danmakuInfo);
}
});
代码示例来源:origin: Rukey7/MvpApp
Logger.w(jsonStr);
Danmakus danmakus = new Danmakus();
if (TextUtils.isEmpty(jsonStr)) {
代码示例来源:origin: Rukey7/MvpApp
/**
* 处理富文本包含图片的情况
* @param newsDetailBean 原始数据
*/
private void _handleRichTextWithImg(NewsDetailInfo newsDetailBean) {
if (!ListUtils.isEmpty(newsDetailBean.getImg())) {
String body = newsDetailBean.getBody();
for (NewsDetailInfo.ImgEntity imgEntity : newsDetailBean.getImg()) {
String ref = imgEntity.getRef();
String src = imgEntity.getSrc();
String img = HTML_IMG_TEMPLATE.replace("http", src);
body = body.replaceAll(ref, img);
Logger.w(img);
Logger.i(body);
}
newsDetailBean.setBody(body);
}
}
}
代码示例来源:origin: Rukey7/MvpApp
/**
* 处理富文本包含图片的情况
*
* @param newsDetailBean 原始数据
*/
private void _handleRichTextWithImg(NewsDetailInfo newsDetailBean) {
if (!ListUtils.isEmpty(newsDetailBean.getImg())) {
String body = newsDetailBean.getBody();
for (NewsDetailInfo.ImgEntity imgEntity : newsDetailBean.getImg()) {
String ref = imgEntity.getRef();
String src = imgEntity.getSrc();
String img = HTML_IMG_TEMPLATE.replace("http", src);
body = body.replaceAll(ref, img);
Logger.w(img);
Logger.i(body);
}
newsDetailBean.setBody(body);
}
}
}
代码示例来源:origin: Rukey7/MvpApp
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mVideoData = getIntent().getParcelableExtra(VIDEO_DATA_KEY);
mPlayerView = new IjkPlayerView(this);
setContentView(mPlayerView);
Logger.w(FileDownloader.getFilePathByUrl(mVideoData.getVideoUrl()));
mPlayerView.init()
.alwaysFullScreen()
.enableOrientation()
.setVideoPath(FileDownloader.getFilePathByUrl(mVideoData.getVideoUrl()))
.setTitle(mVideoData.getTitle())
.start();
}
代码示例来源:origin: orhanobut/logger
Logger.w("no thread info and only 1 method");
Logger.addLogAdapter(new AndroidLogAdapter(formatStrategy));
Logger.w("my log message with my tag");
代码示例来源:origin: GeekGhost/Ghost
private static void w(String className, String messageForW, Object... args) {
if (!BuildConfig.DEBUG) {
org.slf4j.Logger logger = getLoggerInstance(className);
if (logger == null) {
return;
}
logger.warn(messageForW, args);
} else {
Logger.w(handleDebugLogFormat(messageForW), args);
}
}
代码示例来源:origin: mingjunli/GithubApp
/**
* log.w
* @param msg
*/
public static void w(String msg) {
if (BuildConfig.DEBUG) {
Logger.w(msg);
}
}
代码示例来源:origin: liuyanggithub/SuperMvp
/**
* 警告信息
*
* @param TAG
* @param msg
*/
public final static void w(String TAG, String msg) {
Logger.w(TAG, msg);
if (LOG_WRITE_TO_FILE)
writeLogtoFile("w", TAG, msg);
}
代码示例来源:origin: aint/laverna-android
/**
* A method which closes all existed connections.
*/
@Deprecated
public synchronized void closeAllConnections() {
if (mDatabase != null && mDatabase.isOpen()) {
mDatabase.close();
mOpenCounter = 0;
Logger.i("All connections is closed");
}
Logger.w("All connections is closed already");
}
代码示例来源:origin: XunMengWinter/Now
@Override
public void onError(Throwable e) {
if (e == null) {
onFailed(null);
onDisPose();
Logger.e("onError null");
return;
}
e.printStackTrace();
Logger.w("onError " + e.getMessage());
onFailed(e.getMessage());
onDisPose();
}
代码示例来源:origin: szpnygo/NoWordsChat
public static void w(String message) {
if (isPrintLog)
return;
Logger.init(AppConstant.TAG).methodOffset(METHOD_OFFSET).methodCount(METHOD_COUNT);
Logger.w(message);
}
代码示例来源:origin: szpnygo/NoWordsChat
public static void w(String tag, String message) {
if (isPrintLog)
return;
Logger.init(tag).methodOffset(METHOD_OFFSET).methodCount(METHOD_COUNT);
Logger.w(message);
}
代码示例来源:origin: renyuneyun/Easer
@Override
public void onDestroy() {
Logger.i("NotificationEventListenerService onDestroy()");
super.onDestroy();
LocalBroadcastManager.getInstance(getApplicationContext()).unregisterReceiver(mReceiver);
if (dataList.size() > 0) {
Logger.w("Listener to notifications not cleaned up completely: %d left",
dataList.size());
}
}
代码示例来源:origin: huangfangyi/YiChat
public static void w(String tag, String message) {
Logger.init(tag)
.methodCount(METHOD_COUNT)
.logLevel(LOG_LEVEL)
.methodOffset(METHOD_OFFSET);
Logger.w(message);
}
内容来源于网络,如有侵权,请联系作者删除!