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

Class name stripping after dollar sign $ #380

Open
q3769 opened this issue Feb 22, 2023 · 1 comment
Open

Class name stripping after dollar sign $ #380

q3769 opened this issue Feb 22, 2023 · 1 comment

Comments

@q3769
Copy link
Contributor

q3769 commented Feb 22, 2023

if (firstLetter < 'A' || firstLetter > 'Z') {

Not common but a nested/inner class name is allowed to start with a lower case.

Also, I didn't get to read into the code in detail but is the class name stripping just for human readability or it has code logic significance? Seems unnecessary if just for human read. e.g. one might want to know a log message is issued from an anonymous inner class (whose name may be "XyzClass$1"); stripping off the "$1" may not be desired, or even misleading.

@pmwmedia
Copy link
Member

Not common but a nested/inner class name is allowed to start with a lower case.

You are right. However, this is the best heuristic we could find so far. I have never seen any class not starting with an upper case letter in a real world project so far. In tinylog 3, we only strip a nested/inner class name if it starts with a dollar sign or number.

Also, I didn't get to read into the code in detail but is the class name stripping just for human readability or it has code logic significance?

It is mainly for human readability. However, it has also some indirect impact on setting specific severity levels for classes.

Actually, stripping class names is a very demanded feature and should be the default behavior. Nevertheless I could imagine to move the stripping logic to the class placeholder and make it configurable.

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

No branches or pull requests

2 participants