-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
log: add "filename:line" prefix by ourself #1589
Conversation
go-sql-driver#1563 broke the filename:lineno prefix in the log message by introducing a helper function. This commit adds the "filename:line" prefix in the helper function instead of log.Lshortfile option to show correct filename:lineno.
WalkthroughThe MySQL connection code now provides enhanced logging with file name and line number details for better debugging. The Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 2
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- connection.go (2 hunks)
- errors.go (1 hunks)
Files skipped from review due to trivial changes (1)
- errors.go
Additional Context Used
GitHub Check Runs (25)
test (ubuntu-latest, 1.20, 8.0) failure (5)
connection.go: [failure] 55-55:
undefined: pos
connection.go: [failure] 56-56:
undefined: pos
connection.go: [failure] 57-57:
undefined: pos
connection.go: [failure] 62-62:
too many arguments in call to mc.cfg.Logger.Printtest (ubuntu-latest, 1.21, 8.0) failure (5)
connection.go: [failure] 55-55:
undefined: pos
connection.go: [failure] 56-56:
undefined: pos
connection.go: [failure] 57-57:
undefined: pos
connection.go: [failure] 62-62:
too many arguments in call to mc.cfg.Logger.Printtest (windows-latest, 1.22, mariadb-10.6) failure (5)
connection.go: [failure] 55-55:
undefined: pos
connection.go: [failure] 56-56:
undefined: pos
connection.go: [failure] 57-57:
undefined: pos
connection.go: [failure] 62-62:
too many arguments in call to mc.cfg.Logger.Printtest (windows-latest, 1.22, mariadb-10.11) failure (5)
connection.go: [failure] 55-55:
undefined: pos
connection.go: [failure] 56-56:
undefined: pos
connection.go: [failure] 57-57:
undefined: pos
connection.go: [failure] 62-62:
too many arguments in call to mc.cfg.Logger.Printtest (windows-latest, 1.22, mariadb-11.1) failure (5)
connection.go: [failure] 55-55:
undefined: pos
connection.go: [failure] 56-56:
undefined: pos
connection.go: [failure] 57-57:
undefined: pos
connection.go: [failure] 62-62:
too many arguments in call to mc.cfg.Logger.Printtest (windows-latest, 1.22, 5.7) failure (5)
connection.go: [failure] 55-55:
undefined: pos
connection.go: [failure] 56-56:
undefined: pos
connection.go: [failure] 57-57:
undefined: pos
connection.go: [failure] 62-62:
too many arguments in call to mc.cfg.Logger.Printtest (windows-latest, 1.22, 8.3) failure (5)
connection.go: [failure] 55-55:
undefined: pos
connection.go: [failure] 56-56:
undefined: pos
connection.go: [failure] 57-57:
undefined: pos
connection.go: [failure] 62-62:
too many arguments in call to mc.cfg.Logger.Printtest (windows-latest, 1.22, 8.0) failure (5)
connection.go: [failure] 55-55:
undefined: pos
connection.go: [failure] 56-56:
undefined: pos
connection.go: [failure] 57-57:
undefined: pos
connection.go: [failure] 62-62:
too many arguments in call to mc.cfg.Logger.Printtest (macos-latest, 1.22, mariadb-10.5) failure (5)
connection.go: [failure] 55-55:
undefined: pos
connection.go: [failure] 56-56:
undefined: pos
connection.go: [failure] 57-57:
undefined: pos
connection.go: [failure] 62-62:
too many arguments in call to mc.cfg.Logger.Printtest (macos-latest, 1.22, mariadb-10.6) failure (5)
connection.go: [failure] 55-55:
undefined: pos
connection.go: [failure] 56-56:
undefined: pos
connection.go: [failure] 57-57:
undefined: pos
connection.go: [failure] 62-62:
too many arguments in call to mc.cfg.Logger.Printtest (macos-latest, 1.22, mariadb-10.11) failure (5)
connection.go: [failure] 55-55:
undefined: pos
connection.go: [failure] 56-56:
undefined: pos
connection.go: [failure] 57-57:
undefined: pos
connection.go: [failure] 62-62:
too many arguments in call to mc.cfg.Logger.Printtest (macos-latest, 1.22, mariadb-11.1) failure (5)
connection.go: [failure] 55-55:
undefined: pos
connection.go: [failure] 56-56:
undefined: pos
connection.go: [failure] 57-57:
undefined: pos
connection.go: [failure] 62-62:
too many arguments in call to mc.cfg.Logger.Printtest (macos-latest, 1.22, mariadb-11.3) failure (5)
connection.go: [failure] 55-55:
undefined: pos
connection.go: [failure] 56-56:
undefined: pos
connection.go: [failure] 57-57:
undefined: pos
connection.go: [failure] 62-62:
too many arguments in call to mc.cfg.Logger.Printtest (macos-latest, 1.22, 5.7) failure (5)
connection.go: [failure] 55-55:
undefined: pos
connection.go: [failure] 56-56:
undefined: pos
connection.go: [failure] 57-57:
undefined: pos
connection.go: [failure] 62-62:
too many arguments in call to mc.cfg.Logger.Printtest (macos-latest, 1.22, 8.3) failure (5)
connection.go: [failure] 55-55:
undefined: pos
connection.go: [failure] 56-56:
undefined: pos
connection.go: [failure] 57-57:
undefined: pos
connection.go: [failure] 62-62:
too many arguments in call to mc.cfg.Logger.Printtest (macos-latest, 1.22, 8.0) failure (5)
connection.go: [failure] 55-55:
undefined: pos
connection.go: [failure] 56-56:
undefined: pos
connection.go: [failure] 57-57:
undefined: pos
connection.go: [failure] 62-62:
too many arguments in call to mc.cfg.Logger.Printtest (ubuntu-latest, 1.22, mariadb-10.5) failure (5)
connection.go: [failure] 55-55:
undefined: pos
connection.go: [failure] 56-56:
undefined: pos
connection.go: [failure] 57-57:
undefined: pos
connection.go: [failure] 62-62:
too many arguments in call to mc.cfg.Logger.Printtest (ubuntu-latest, 1.22, mariadb-10.6) failure (5)
connection.go: [failure] 55-55:
undefined: pos
connection.go: [failure] 56-56:
undefined: pos
connection.go: [failure] 57-57:
undefined: pos
connection.go: [failure] 62-62:
too many arguments in call to mc.cfg.Logger.Printtest (ubuntu-latest, 1.22, mariadb-10.11) failure (5)
connection.go: [failure] 55-55:
undefined: pos
connection.go: [failure] 56-56:
undefined: pos
connection.go: [failure] 57-57:
undefined: pos
connection.go: [failure] 62-62:
too many arguments in call to mc.cfg.Logger.Printtest (ubuntu-latest, 1.22, mariadb-11.1) failure (5)
connection.go: [failure] 55-55:
undefined: pos
connection.go: [failure] 56-56:
undefined: pos
connection.go: [failure] 57-57:
undefined: pos
connection.go: [failure] 62-62:
too many arguments in call to mc.cfg.Logger.Printtest (ubuntu-latest, 1.22, mariadb-11.3) failure (5)
connection.go: [failure] 55-55:
undefined: pos
connection.go: [failure] 56-56:
undefined: pos
connection.go: [failure] 57-57:
undefined: pos
connection.go: [failure] 62-62:
too many arguments in call to mc.cfg.Logger.Printtest (ubuntu-latest, 1.22, 5.7) failure (5)
connection.go: [failure] 55-55:
undefined: pos
connection.go: [failure] 56-56:
undefined: pos
connection.go: [failure] 57-57:
undefined: pos
connection.go: [failure] 62-62:
too many arguments in call to mc.cfg.Logger.Printtest (ubuntu-latest, 1.22, 8.3) failure (5)
connection.go: [failure] 55-55:
undefined: pos
connection.go: [failure] 56-56:
undefined: pos
connection.go: [failure] 57-57:
undefined: pos
connection.go: [failure] 62-62:
too many arguments in call to mc.cfg.Logger.Printtest (ubuntu-latest, 1.22, 8.0) failure (5)
connection.go: [failure] 55-55:
undefined: pos
connection.go: [failure] 56-56:
undefined: pos
connection.go: [failure] 57-57:
undefined: pos
connection.go: [failure] 62-62:
too many arguments in call to mc.cfg.Logger.Printlint failure (10)
connection.go: [failure] 55-55:
undefined: pos
connection.go: [failure] 56-56:
undefined: pos
connection.go: [failure] 57-57:
undefined: pos
connection.go: [failure] 62-62:
too many arguments in call to mc.cfg.Logger.Print
connection.go: [failure] 55-55:
undefined: pos
connection.go: [failure] 56-56:
undefined: pos
connection.go: [failure] 57-57:
undefined: pos
connection.go: [failure] 62-62:
too many arguments in call to mc.cfg.Logger.Print
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.
Actionable comments posted: 0
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
go-sql-driver#1563 broke the filename:lineno prefix in the log message by introducing a helper function. This commit adds the "filename:line" prefix in the helper function instead of log.Lshortfile option to show correct filename:lineno. (cherry picked from commit 2f7015e)
#1563 broke the filename:lineno prefix in the log message by introducing a helper function.
This commit adds the "filename:line" prefix in the helper function instead of log.Lshortfile option to show correct filename:lineno.
Checklist