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

TextLog integrations with native loggers #3522

Merged
merged 11 commits into from Sep 29, 2023
Merged

TextLog integrations with native loggers #3522

merged 11 commits into from Sep 29, 2023

Conversation

teh-cmc
Copy link
Member

@teh-cmc teh-cmc commented Sep 28, 2023

Everything to seamlessly integrate TextLog with native loggers in Python & Rust.

Checklist

@teh-cmc teh-cmc added 📖 documentation Improvements or additions to documentation 🐍 Python API Python logging API 🦀 Rust API Rust logging API examples Issues relating to the Rerun examples 🍏 primitives Relating to Rerun primitives labels Sep 28, 2023
@teh-cmc teh-cmc marked this pull request as draft September 28, 2023 16:07
@teh-cmc teh-cmc marked this pull request as ready for review September 28, 2023 16:43
@teh-cmc teh-cmc marked this pull request as draft September 28, 2023 16:57
@teh-cmc teh-cmc marked this pull request as ready for review September 28, 2023 17:47
@teh-cmc teh-cmc added the do-not-merge Do not merge this PR label Sep 28, 2023
@teh-cmc teh-cmc changed the base branch from main to cmc/file_sink_flushes September 28, 2023 17:48
Base automatically changed from cmc/file_sink_flushes to main September 28, 2023 18:26
teh-cmc added a commit that referenced this pull request Sep 28, 2023
`FileSink` currently ignores flushing requests, which leads to [very
hard to track down issues where data is silently dropped even though
you're really really trying very hard to flush that dang
RecordingStream](#3522 (comment)).

- Unblocks #3522
@teh-cmc teh-cmc removed the do-not-merge Do not merge this PR label Sep 28, 2023
@Wumpf Wumpf self-requested a review September 29, 2023 09:06
Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

looking great!

""" Designates very low priority, often extremely verbose, information. """

@staticmethod
def deferred_patch_class(cls: Any) -> None:
Copy link
Member

Choose a reason for hiding this comment

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

is it somehow guaranteed that this runs before other classes are initialized? In particular I'm concerned that LoggingHandler's LVL2NAME dictionary may still read the none values, not the strings

Copy link
Member Author

Choose a reason for hiding this comment

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

deferred_patch_class is called as part of the global import scope, so it should be guaranteed as far as I know yes.

log::Level::Debug => TextLogLevel::DEBUG,
log::Level::Trace => TextLogLevel::TRACE,
}
.into()
Copy link
Member

Choose a reason for hiding this comment

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

unnecessary .into()?

Copy link
Member Author

Choose a reason for hiding this comment

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

TextLogLevel::TRACE & friends are actually &strs because TextLogLevel isn't const

@teh-cmc teh-cmc merged commit 9451e82 into main Sep 29, 2023
14 of 19 checks passed
@teh-cmc teh-cmc deleted the cmc/logging_logs branch September 29, 2023 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📖 documentation Improvements or additions to documentation examples Issues relating to the Rerun examples include in changelog 🍏 primitives Relating to Rerun primitives 🐍 Python API Python logging API 🦀 Rust API Rust logging API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TextLog integration with native logging tools
3 participants