Comments (8)
Why do you actually want to do that? So that you don't have to change your code?
Otherwise, there is no real difference in logging via L.d(...)
or via Timber.d(...)
...
from lumberjack.
Yes, it is so that I don't have to change, and also I just wanted the file logging capabilities of L. at the moment I am using another library, I wanted to save my data transactions like this...
Timber.d("uploading json " + bodyApi);
XLog.d("uploading json " + bodyApi);
from lumberjack.
so I think a method to console log, and a separate method to file log would be cool, something like
L.d behaves like Timber.d console only, and L.f logs to file and console. Also I had trouble finding L.i (maybe this is a separate issue).
from lumberjack.
Actually, this is defeating one of Timbers
features, registering trees and don't think about them anymore. Timber just logs to all registered trees automatically.
Writing 2 lines for each debug line is annoying, isn't it?
What you could try is following: write your own logToConsoleOnly
function like following:
- unregister the file logger
- use
L.d
- register the file logger again
PS: L.i
is just not written yet, I always log at debug level. I'll add this, I just need to write the few forwarding functions from L
to Timber
...
from lumberjack.
true enough. I think then we can close this issue as well. Thank you for being so quick to respond!
from lumberjack.
You need to adjust the stack trace depth in this function, because your wrapping function will add one level to it...
So in this function you'll need to call L.d(ILogGroup group, int callStackCorrection, String message, Object... args)
to take care of this...
I'll update the library today and add following:
- I'll add this function:
L.d(int callStackCorrection, String message, Object... args)
so you can use this function in your function - I'll add the missing log levels (i, w, v)
from lumberjack.
Done. You can try https://github.com/MFlisar/Lumberjack/releases/tag/1.3 now...
from lumberjack.
New version v2 supports filtering on a per tree base, just pass in a https://github.com/MFlisar/Lumberjack/blob/master/library/src/main/java/com/michaelflisar/lumberjack/filter/ILogFilter.java to the tree constructors that filters out any group or priority you don't want to log with the tree...
from lumberjack.
Related Issues (17)
- Synthetic stacktrace didn't have enough elements: are you using proguard? HOT 5
- Log messages do not contain full package name HOT 1
- Not Compatible With Timber 5 HOT 4
- How to extend the provided Trees in Kotlin? HOT 1
- File Returned By getAllExistingLogFiles() Does Not Exist HOT 2
- Fails to show notification on api 31+ HOT 1
- Getting parse error when using file logging. HOT 1
- Runtime crash HOT 6
- Could not find com.github.MFlisar:CacheFileProvider:0.2. HOT 4
- Sending log file by email crashes when FileProvider paths are used in application HOT 2
- Create different instance or store to a different file HOT 2
- Overlay logger - Advanced filter options HOT 1
- Overlay logger - Open advanced activity HOT 3
- Overlay logger - more layout options HOT 1
- General - improve filter HOT 1
- code line number is repeated HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lumberjack.