elvishew / xlog Goto Github PK
View Code? Open in Web Editor NEWAndroid logger, pretty, powerful and flexible, log to everywhere, save to file, all you want is here.
License: Apache License 2.0
Android logger, pretty, powerful and flexible, log to everywhere, save to file, all you want is here.
License: Apache License 2.0
The xLog is very powerful and pretty, i am excited in using it.
but when i use the function of printing log to the sdcrad, i meet some question.
for example,when i use a globalFilePrinter and a LocalFilePrinter in the same time,and set the file path same,and the filename generator by date as also, it would't create two log file, they will write in a same file. is it a BUG?
in another case, I just use a globalFilePrinter,then it will create one log file, does the xLog has the ability to clear the log file automatically ? If not ,the log file will be very large.
Is there any way to change default timestamp from epoch to date string
1486381070403|D|X-LOG|Simple message
to
Mon, 06 Feb 2017 11:37:50.403 GMT|D|X-LOG|Simple message
建议检测一下,防止崩溃!
XLog.w("MYTAG", "hello klog");
只打印 MYTAG, 后面没有了??
Hi,I know Xlog is great,but I incomprehension why there is a log backup function,If you can tell me It applies to which scenes?I will be very grateful.
Android 7.0,XLog.d() XLog.v()不打印
在不同的类里面设置不用的TAG,不想使用局部的用法,每次设置很多参数太麻烦,怎样实现动态设置TAG
保存日志到本地文件,时间全部是毫秒值,可否设置为yyyy-MM-dd HH:mm形式?
I init your xLog in the application onCreate() with XLog.init(LogLevel.ALL);
, but when I run my project it fail to print json string, only give me this error com.elvishew.xlog.formatter.FormatException: Parse JSON error.
It's works well using android.util.Log
to print the json string, don't know anything wrong, any help?
你好,日志文件输出是 12小时制的 但没有AM/PM标志 这个可以设置吗?
我在application的onCreate()中初始化的XLog,不知道什么原因执行到这里有时候回卡死在这里,捕获异常也没有反应,我猜测是内部异常了但是没有抛出,导致卡死
开发阶段需要输出log,产品上线后想关闭,有这个的方法吗?
Hi,
Can you add the possibility to check whether the XLog
has already been initialized?
When I run a bunch of Robolectric tests the following exception is being thrown:
java.lang.RuntimeException: java.lang.IllegalStateException: XLog is already initialized, do not initialize again
I am initializing the XLog
in my application subclass:
override fun onCreate() {
super.onCreate()
XLog.init(if (BuildConfig.DEBUG) LogLevel.ALL else LogLevel.NONE)
}
It seems that Robolectric creates the application multiple times but XLog
for some reason stays initialized.
What do you think? Maybe the public getter of sIsInitialized would be enough to solve this issue?
I initialize XLog in my project by code:
XLog.init(new LogConfiguration.Builder()
.logLevel(Config.isLogEnabled() ? LogLevel.ALL : LogLevel.NONE)
.t()
.st(3)
.b()
.build());
The log level is set to LogLevel.NONE
in release version, but I have a secret log switch to debug something, so, how can I change log level after XLog initialized?
😄
Sometime I defined my L.java, and I use XLog in L.java.
L.java have some methods, example:
public static void e(String contents) {
log(contents);
}
private static void log(String contents) {
XLog.e(contents);
}
then I use L.java in MainActivity
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
L.e("Hello World");
}
I set st(3), and the log is :
├ com.whyalwaysmea.basemodule.L.log(L.java:156)
║ ├ com.whyalwaysmea.basemodule.L.e(L.java:127)
║ └ com.whyalwaysmea.diycode.MainActivity.onCreate(MainActivity.java:23)
Can I only see the last Info(MainActivity.java)? how to do it?
Thanks.
java层接口提供了,现在想要c层中也使用,有办法么,谢谢!
1479185204301|W|MY_TAG|╔═══════════════════════════════════════════════════════════════════════════════════════════════════
║Thread: RxComputationScheduler-1
╟───────────────────────────────────────────────────────────────────────────────────────────────────
║ ├ com.jp.rxjavademo.MainActivity$9.onNext(MainActivity.java:236)
║ ├ com.jp.rxjavademo.MainActivity$9.onNext(MainActivity.java:223)
║ ├ rx.internal.util.ObserverSubscriber.onNext(ObserverSubscriber.java:34)
║ └ rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:134)
╟───────────────────────────────────────────────────────────────────────────────────────────────────
║combineLatest: 177
╚═══════════════════════════════════════════════════════════════════════════════════════════════════
up主,你好,我在初始化XLog
的时候,设置了一个filePrinter
,文件路径是通过一个封装过的工具类:StorageUtil
获取的,获取这个路径的时候,做了一个“是否要创建目录”的判断,同时输出相关日志,此时由于XLog并未初始化,导致崩溃,所以,想手工判断一下是否初始化,否则不用XLog输出。
PS: XLog暂时用做日志文件备份,项目中还是有一个日志工具的,只不过在那个日志工具调用Log.x()后,再调用XLog
Hi,
I need help with writing log files to device internal storage. How do we do that with xlog? Any help will be appreciated. Thanks in advance.
String jsonString = "{"name": "Elvis", "age": 18}";
XLog.json(jsonString);
打印不出来..
is it possible to save log file names by tag?
如题,当应用崩溃需要捕捉崩溃信息,并发送到服务器,请问有这个功能吗
static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd hh:mm:ss.SSS";
should be
static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss.SSS";
我在将自己的LogUtils中的Log.i (...)替换成XLog.i(..),但是无法打印调用者的行号,总是打印LogUtils中的行号,这个有办法解决吗?
项目中有个新需求就是有些日志我需要保存文件中,有些日志我不需要保存在文件中,能否有比较简洁方法解决这个需求
As title, we have some concern about performance impact.
can auto delete logs by time or other ways
I just used XLOG in my project, it does not work on my pad , i have no idea about that , even logcat print no except about XLOG, but when i use Log.i(TAG,MSG) then i can get the MSG in my logcat, how can i fix that?
P.S. the HUAWEI BTV-W09 's sdk version is 25 (Android7.0)
how to send logs to Internet
I'm looking for a way to customize log levels. E.g. we don't use verbose
but we do use critical
(higher than error). Currently all I can do is "transpose" the log levels with a wrapper and an interceptor or something making everything a mess (and stack traces incorrect because the wrapper is irrelevant).
as title
Hi.
First of all I have to say this is a very perfect library, But I wish it support custom tag likes log.
你好,请问怎样打印出线程与输出日志所在的代码行数,就像orhanobut的logger中那样。
如下面的:
Thread: main与MainActivity.initData (MainActivity.java:66)
╔═══════════════════════════════════════════
║ Thread: main
╟──────────────────────────────
║ MainActivity.initData (MainActivity.java:66)
╟──────────────────────────────
║ {
║ "name": "Elvis",
║ "age": 18
║ }
╚═══════════════════════════════════════════
当我这样使用时 XLog.e(TAG , "LOG");
他只输出前面的tag,不输出后面的Log
Hi,
First of all thanks for such a wonderful library.
How can i encrypt/decrypt logs using this library. I want to store and read logs from encrypted file, so that normal user can't read the logs. One way is to add them in (.Folder) but still a user can access the files
Gradle:2.2.2
Debug build
I compiled this library in my project's library module.
And init it in my application by XLog.init(BuildConfig.DEBUG ? LogLevel.ALL : LogLevel.NONE, new LogConfiguration.Builder().t().b().build());
.
The library module is compiled by compile project(':library')
in gradle file.My application is registered correctly in AndroidManifest.xml
.
But it cannot print anything in activity when invoke XLog.d(msg);
.
What's wrong?Thx.
在 JSONObject JSONArray 同时有互相包含时的情况
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.