Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

orhanobut/logger vs xLog #104

Open
iadcialim opened this issue Jun 26, 2021 · 12 comments
Open

orhanobut/logger vs xLog #104

iadcialim opened this issue Jun 26, 2021 · 12 comments

Comments

@iadcialim
Copy link

Question. Sorry, but how is this different from https://github.com/orhanobut/logger?

@elvishew
Copy link
Owner

@iadcialim xLog is more like a logger framework and contains some built-in implementations, all components are customizable.
logger is simple and lightweight, but not so easy to customize.

You can go through the doc in README.md, you will know the differences.

It's recommended to use xLog instead of logger when developing a new project.

@elvishew
Copy link
Owner

@iadcialim Also you can take a look at the issue I created in logger
orhanobut/logger#255

@elvishew elvishew pinned this issue Jun 26, 2021
@iadcialim
Copy link
Author

Thank you @elvishew for the answer. After checking README and that ticket in orhanobut/logger#255, it's pretty clear that xLog is very extensive and highly customizable especially the main customizations and strategies for managing logs in a file. I am going to use this one moving forward instead of logger =)

@iadcialim
Copy link
Author

I really like the pretty logs in my logcat window and the ease of clicking on the class-line number link to jump to the line where its prints the logs - this is very convenient to us developers.
Now I am thinking of saving the logs in a file and later retrieve them from the device.
But I am just thinking if it's possible to load the contents of a log file into the logcat window.
So that I can enjoy the convenience in the first sentence above.

@elvishew
Copy link
Owner

I really like the pretty logs in my logcat window and the ease of clicking on the class-line number link to jump to the line where its prints the logs - this is very convenient to us developers.
Now I am thinking of saving the logs in a file and later retrieve them from the device.
But I am just thinking if it's possible to load the contents of a log file into the logcat window.
So that I can enjoy the convenience in the first sentence above.

It's possible, but you need to load by yourself(just like loading a normal file) and print the contents to logcat via AndroidPrinter

@iadcialim
Copy link
Author

Do you mean by parsing the contents of the log file and logging them again?

@elvishew
Copy link
Owner

Do you mean by parsing the contents of the log file and logging them again?

Yes, but don't log them to file again, just log to logcat by specifyingAndroidPrinter(how to? you can refer to README)

@iadcialim
Copy link
Author

Do I need to run an android app for this to log again the contents of the log file? Or is there a way to easily feed the logfile into logcat?

@elvishew
Copy link
Owner

Do I need to run an android app for this to log again the contents of the log file? Or is there a way to easily feed the logfile into logcat?

No, there is no such tool to "replay" the log file to the terminal.

If you just want to "view" the content of the log file, why not just cat them to the terminal?

@iadcialim
Copy link
Author

So that I can click on the link in the logs and it will jump on the file and line number in Android Studio =)

@elvishew
Copy link
Owner

So that I can click on the link in the logs and it will jump on the file and line number in Android Studio =)

If you cat them in Android Studio's terminal tab, YES.

The click-and-jump is a feature of Android Studio.
Just try it.

@iadcialim
Copy link
Author

Ya, it worked. Awesome man!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants