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

Add log format documentation to the book #785

Merged
merged 5 commits into from
Jan 10, 2024

Conversation

andresovela
Copy link
Contributor

@andresovela andresovela commented Oct 10, 2023

This PR adds a chapter to the defmt book about customizing logs using the log format functionality. This PR shouldn't be merged until #783 is merged.

@Urhengulas
Copy link
Member

Just mention that it can be passed as --log-format to all three of those. And that due to a cargo config parsing restriction, runner needs to be an array of string instead of just a string.


There are several metadata specifiers available that can be used in a format string.

#### Log - `{s}`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#### Log - `{s}`
### Log - `{s}`

I think a 3-# heading is correct here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I made these level-4 intentionally because it looks better in the book.

}
```

#### Timestamp - `{t}`
Copy link
Contributor

Choose a reason for hiding this comment

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

I think #789 means we need some more entries in here now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really, the {t} specifier prints whatever defmt::timestamp! prints

@jonathanpallant
Copy link
Contributor

This looks great, thank you so much! Just a couple of minor notes.

@Urhengulas Urhengulas disabled auto-merge January 10, 2024 14:49
@Urhengulas Urhengulas merged commit 60047a2 into knurling-rs:main Jan 10, 2024
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants