Commit 954af5d
committed
Remove slog-async dependency
According to the slog-term docs:
> PlainSync Decorator implementation
>
> This implementation is exactly like PlainDecorator but it takes
> care of synchronizing writes to io.
Since we care about colouring, wrap a slog_term::TermDecorator in a
std::sync::Mutex so that coloured output is still maintained.
This ensures that log messages will not be dropped when the logging
rate exceeds the backend's ability to drain (as the previous
slog-async backend could do). Previously when this occurred, the log
output would show the following:
slog-async: logger dropped messages due to channel overflow
An alternative might be to keep the slog-async dependency but use
slog_async::OverflowStrategy::Block to ensure that overflowing writes
will block, rather than forcing each write through the mutex.
Fixes #1311 parent 425cb17 commit 954af5d
3 files changed
+2
-36
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| |||
0 commit comments