-
Notifications
You must be signed in to change notification settings - Fork 46
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
could u support timbre log library #83
Comments
I think it should be possible to add timbre as an option to the template. It would be a matter of changing the dependency and the config files. And not sure about adding line numbers outside exceptions. |
I also believe it's possible to get clojure.tools.logging to log out to Timbre via https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre/tools/logging.clj#L38 Note: I haven't tried this, so if you do get it working would be worth commenting back since it might be nice to have it as a template option, or module |
@nikolap yes, it can works, but it can not show line number, the reason i want to use timbre is that
|
I'm not familiar with Timbre, however clojure.tools.logging wraps your chosen Java logging provider. e.g. logback is the default one. Perhaps one of these supports your request. Based off of how Timbre implements it, you could do something like this https://www.reddit.com/r/Clojure/comments/sxwmt9/how_to_log_line_numbers_with_toolslogging/ Hope that helps |
@nikolap thanks, it says |
Yes, the core namespace would be the entry point. I didn't try the reddit answer extensively, so you may need to tweak it, e.g. to support levels beside INFO. But it certainly worked from the REPL. However, it won't work for logging produced by non- clojure.tools.logging calls since it's a redef of log/info. Maybe there's also other ways to enable log numbers in one of the clojure.tools.logging supported logging implementations. |
i tested , maybe |
might be worth updating the template to do this by default |
OK, i will send a pr later, how can i test in my pc?
|
you can try running |
hello,
i usually use timebre instead of tools/logging
another question: how to log the current file line when use tools.logging
The text was updated successfully, but these errors were encountered: