Skip to content

Add log format documentation to the book#785

Merged
Urhengulas merged 5 commits intoknurling-rs:mainfrom
andresovela:log-format-book
Jan 10, 2024
Merged

Add log format documentation to the book#785
Urhengulas merged 5 commits intoknurling-rs:mainfrom
andresovela:log-format-book

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
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