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

Trim anonymous classes from classname #10

Closed
h4ste opened this issue Aug 13, 2015 · 2 comments
Closed

Trim anonymous classes from classname #10

h4ste opened this issue Aug 13, 2015 · 2 comments
Milestone

Comments

@h4ste
Copy link

h4ste commented Aug 13, 2015

I don't know how to tag this as a feature request and not a bug, but I was wondering if it would be possible to trim or remove the anonymous class portion from the classname written by the logger?

For example,

In tinylog.writer1.format I have:
tinylog.writer1.format = {date:hh:mm:ss.SSS} | {level} | {class}: {message}

In my source file, WikiParser I use extensive logging using some java 8 streams and junk. Unfortunately, the messages are formatted as:
03:45:54.177 | INFO | edu.utdallas.hltri.copa.wiki.WikiParser$$anonfun$2$$anonfun$apply$2$$anonfun$apply$4$$anonfun$apply$6$$anonfun$apply$8$$anonfun$apply$10: [Parsing XML] Saved "Mekong"

What I would like to see:
03:45:54.177 | INFO | edu.utdallas.hltri.copa.wiki.WikiParser: [Parsing XML] Saved "Mekong"

It seems, naively, that it might be as simple as triming everything in the classpath after (and including) the first '$'. I would have done this myself, but I can't figure out how to implement a custom format and I can't override the existing behavior because everything is final.

@pmwmedia
Copy link
Member

comprehensible feature request, it is on the to-do list

@pmwmedia pmwmedia added this to the 2.0 milestone Oct 21, 2015
@pmwmedia pmwmedia modified the milestones: 2.0, 1.1 Dec 13, 2015
@github-actions
Copy link

github-actions bot commented Oct 9, 2022

This closed issue has been locked automatically. However, please feel free to file a new issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants