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

Handle non-strings in logs. #7985

Merged
merged 1 commit into from Aug 28, 2022
Merged

Conversation

Julian-O
Copy link
Contributor

@Julian-O Julian-O commented Aug 27, 2022

Fixes #7984

LogRecords may contain non-string messages (not just non-string args) that aren't converted to strings until the last moment (to save expensive effort if the log message is never emitted).

Bug introduced recently with Colored/UncoloredLogRecords did not convert to str before replacing color markings (if any).

  • str() added.
  • Unit tests added (used to fail, now pass)

Maintainer merge checklist

  • Title is descriptive/clear for inclusion in release notes.
  • Applied a Component: xxx label.
  • Applied the api-deprecation or api-break label.
  • Applied the release-highlight label to be highlighted in release notes.
  • Added to the milestone version it was merged into.
  • Unittests are included in PR.
  • Properly documented, including versionadded, versionchanged as needed.

LogRecords may contain non-string messages (not just non-string args) that aren't converted to strings until the last moment (to save expensive effort if the log message is never emitted).

Bug introduced with Colored/UncoloredLogRecords did not convert to str before replacing colour markings (if any).

str() added.
Unit tests added (used to fail, now pass)
@misl6 misl6 added this to the 2.2.0 milestone Aug 28, 2022
@misl6 misl6 added the Component: core-app app, clock, config, inspector, logger, resources, modules, clock, base.py label Aug 28, 2022
Copy link
Member

@misl6 misl6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

@misl6 misl6 merged commit 5981bce into kivy:master Aug 28, 2022
@Julian-O Julian-O deleted the #7984nonstringlogging branch August 28, 2022 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: core-app app, clock, config, inspector, logger, resources, modules, clock, base.py
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kivy Logger doesn't take into account non-string messages
2 participants