Closed daboross closed 7 years ago
Hey there!
Yeah, this seems sensible to me. Maybe it's worth even avoiding the level
variable by using writeln
more generically on a reference to the correct stdout/err if we're going this direction.
My internet is a bit screwy at the moment, so will have to wait a bit to publish, a new version, but will merge this ASAP. :+1:
Thank you.
No problem, thank you for merging!
I don't think the level
variable should have much of an impact since it's only on the stack, but making it more generic by using writeln
could benefit clarity.
Hi!
Hope this works here. Found this crate via some recent blog posts, and thought I'd see if I could help at all.
This commit removes the allocation of an intermediate
String
inlog
, so the log path is now allocation-free. This is likely a premature optimization, but it's a small change for much faster logging - and not allocation when not needed is a plus, in my mind.