File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -74,9 +74,8 @@ fn default_enable_ansi_color() -> bool {
7474
7575/// Gets the current thread id as an integer
7676///
77- /// This only supports the normal platforms here, I doubt this crate has wide usage,
78- /// we just hard compile fail if targeting a platform we don't implement so
79- /// that it is obvious
77+ /// This only supports the normal platforms here (Linux, Windows, Apple).
78+ /// For anything else like WASM we just return 0.
8079///
8180/// Note that a Rust `ThreadId` is actually just a process specific atomic,
8281/// completely unrelated to the thread id assigned by the operating system, but
@@ -121,6 +120,15 @@ fn current_thread_id() -> u64 {
121120
122121 id
123122 }
123+
124+ #[ cfg( not( any(
125+ any( target_os = "linux" , target_os = "android" ) ,
126+ target_os = "windows" ,
127+ target_vendor = "apple"
128+ ) ) ) ]
129+ {
130+ 0
131+ }
124132}
125133
126134impl < S , N > FormatEvent < S , N > for EventsFormatter
Original file line number Diff line number Diff line change @@ -77,6 +77,9 @@ impl Builder {
7777 self
7878 }
7979
80+ /// Enable emitting the thread id in log output.
81+ ///
82+ /// Note: On unsupported targets like WASM, the thread id will be `0`.
8083 pub fn with_thread_ids ( mut self , enable : bool ) -> Self {
8184 self . events . with_thread_ids = enable;
8285 self
You can’t perform that action at this time.
0 commit comments