Drakulix / simplelog.rs

Simple Logging Facility for Rust
https://docs.rs/simplelog/
Apache License 2.0
439 stars 73 forks source link

Added a thread id output. #24

Closed kurtlawrence closed 5 years ago

kurtlawrence commented 6 years ago

Added a thread id output such that the output follows <time> <level> <thread_id>.

Thread id comes from std::thread::current().id() as a ThreadId which, for now, is backed by a u64.

I decided to output the id as a number, encased in brackets. I am not too fussed about the format. ThreadId does not implement Display so I have deconstructed the debug format to return just the number (debug output is ThreadId(#)).

I decided to use the string replace function rather than take a slice &id[9..id.len()-1] as there may be no guarantee that the debug format remains constant.

😄

Drakulix commented 6 years ago

Thanks, looks good, just some minor complains.

  1. Can you remove the .vscode files please?
  2. Can you format the code using rustfmt?
kurtlawrence commented 6 years ago

Hi @Drakulix,

I removed the .vscode folder, sorry that slipped in there.

Regarding the formatting using rustfmt, I used the default formatting settings and it has changed more than just my code (mostly splitting where lines). Did you have any specific formatting settings?

Cheers,

Kurt

Drakulix commented 6 years ago

I thought, I have a rustfmt config in place, turns out I have not, I just noticed some weird intends in your code.

Thanks for your work, I will take care of the formatting and merge this soon.

Drakulix commented 5 years ago

Merged manually via #37