Skip to content

Commit b4065ee

Browse files
committed
Set log target to module path
Log crate defaults to module path if target is not specified. Other log crates allow to filter by target (e.g. `env_logger::Builder::parse_filters()`).
1 parent 01c396a commit b4065ee

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/logger.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ impl LogWriter for Writer {
153153
#[cfg(not(feature = "uniffi"))]
154154
log::logger().log(
155155
&builder
156+
.target(record.module_path)
156157
.module_path(Some(record.module_path))
157158
.line(Some(record.line))
158159
.args(format_args!("{}", record.args))
@@ -161,6 +162,7 @@ impl LogWriter for Writer {
161162
#[cfg(feature = "uniffi")]
162163
log::logger().log(
163164
&builder
165+
.target(record.module_path)
164166
.module_path(Some(&record.module_path))
165167
.line(Some(record.line))
166168
.args(format_args!("{}", record.args))

0 commit comments

Comments
 (0)