-
Notifications
You must be signed in to change notification settings - Fork 290
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
[mysql] pipe logger into mysql for debug printing (#1055) #2217
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
recheck |
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.
LGTM, had a couple of questions
|
||
func Print(v ...interface{}) { | ||
Logger.Debug().CallerSkipFrame(1).Msg(fmt.Sprint(v...)) | ||
} | ||
|
||
func Printf(format string, v ...interface{}) { | ||
Logger.Debug().CallerSkipFrame(1).Msgf(format, v...) | ||
} |
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.
I take it these are otherwise unused?
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.
yep!
type debugLogger struct{} | ||
|
||
func (debugLogger) Print(v ...any) { | ||
log.Logger.Debug().CallerSkipFrame(1).Msg(fmt.Sprint(v...)) | ||
} |
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.
Is this specific to MySQL? Is it worth extending to the other datastores as well? It's also okay if that's outside of the scope of this PR.
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.
every datastore seems to have its own interface -- this particular one is specific to mysql, alas....
1637f0b
to
fa5e56e
Compare
Renames some variables for clarity, remove unused logging functions and add MySQL debug printing support.