Skip to content

Derive/implement Debug for Config and AndroidLogger#81

Merged
Nercury merged 1 commit into
masterfrom
marijn/unconditionally-derive-debug
Mar 4, 2025
Merged

Derive/implement Debug for Config and AndroidLogger#81
Nercury merged 1 commit into
masterfrom
marijn/unconditionally-derive-debug

Conversation

@MarijnS95

Copy link
Copy Markdown
Member

Closes #79

Allows these structs to be printed, useful for supposedly the log4rs crate which requires this to be implemented on AndroidLogger.

Comment thread src/lib.rs
/// Create a new logger with default config
fn default() -> AndroidLogger {
AndroidLogger {
config: OnceLock::from(Config::default()),

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is what Default already does on OnceLock. Since that's the only member, we can simply have #[derive(Default)] struct AndroidLogger ....

Comment thread src/lib.rs Outdated
@Nercury

Nercury commented Mar 4, 2025

Copy link
Copy Markdown
Collaborator

@MarijnS95 Let me know when you are ready to merge, ping me.

@MarijnS95

Copy link
Copy Markdown
Member Author

@Nercury thanks, I think this is ready for review. The only open comment was meant for educational purposes to reviewers (to understand why I was making a drive-by change), not something that still needs to change it seems 🙂

@Nercury

Nercury commented Mar 4, 2025

Copy link
Copy Markdown
Collaborator

Whoops, merge conflict.

Allows these structs to be printed, useful for supposedly the `log4rs`
crate which requires this to be implemented on `AndroidLogger`.
@MarijnS95 MarijnS95 force-pushed the marijn/unconditionally-derive-debug branch from b98be74 to cac592f Compare March 4, 2025 14:25
@MarijnS95 MarijnS95 requested a review from Nercury March 4, 2025 14:25
@Nercury Nercury merged commit b4f7783 into master Mar 4, 2025
@MarijnS95 MarijnS95 deleted the marijn/unconditionally-derive-debug branch March 4, 2025 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants