-
Notifications
You must be signed in to change notification settings - Fork 3
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
SEVERE BUG IN LOGKITTEN -- INCORRECT LOGGING #207
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please test and ensure that the logging format is the same. Then will merge.
Logging will not be the same, that's the point. This changes the logging. |
can one of you guys that's merging all my PRs from literally two years ago glance at this? this is a legitimate bug. |
X calls Y calls LogKitten.warn. LogKitten says "Y had a warning" this is a giant foot-gun and could cause very hard to debug incorrect logging. there is one example currently. LogKitten.logMessage REALLY SHOULD be a private method. |
Leaving
logMessage(Object message, KittenLevel level, boolean override)
as public introduces a subtle bug.This method gets the fifth item in the stack trace. Normally, a class calls, for example
void f(Object message) { // Log fatal message
, which then callsLogKitten.logMessage(message, KittenLevel.FATAL, false);
. This results in the fifth item in the stack trace being, as expected, the function that calls LogKitten.However, if
logMessage
were public, the fifth item in the stack trace would be the function that calls the function that calls logkitten, resulting in incorrect logging.The levels of indirection in calling LogKitten must be standardized, otherwise logging of what function called LogKitten will be inconsistent.