demml / demml/rusty-logger

Output wrapped in `msg="..."`

Open
#32 1 comment 0 reactions 1 assignee Claimed by @thorrester View on GitHub
bug python
Dominant language
Rust
Stars
15
Forks
0
PR merge metrics
No merged PRs in 30d

Description

I just found your very promising library! Cool project!

### Checks

- [x] I have checked that this issue has not already been reported.
- [x] I have confirmed this bug exists on the [latest version](https://pypi.org/project/rusty-logger/) of Rusty Logger.

### Reproducible example

```python
from rusty_logger import LoggingConfig, LogLevel, RustyLogger

RustyLogger.setup_logging(
config=LoggingConfig(
log_level=LogLevel.Debug if config.verbose else LogLevel.Info,
show_threads=False,
)
)

from rusty_logger import RustyLogger
logger = RustyLogger.get_logger()

logger.info(f"Filesystem: s3")
logger.info("Connecting to ECMWF datastore")
```

### Log output

```shell
2026-03-06T20:23:28::6021 INFO msg="Filesystem: s3"
2026-03-06T20:23:28::7097 INFO msg="Connecting to ECMWF datastore"
```

### Issue description

The output is wrapped in `msg=""`

I suspect something like this would be needed in [logger.rs](https://github.com/demml/rusty-logger/blob/main/crates/rusty_logger/src/logger.rs#L253)
```diff
#[pyo3(signature = (message, *args))]
pub fn info(&self, message: &str, args: &Bound<'_, PyTuple>) {
let args = parse_args(args);
let msg = match args {
Some(val) => format_string(message, &val),
None => message.to_string(),
};
- tracing::info!(msg);
+ tracing::info!("{}", msg)
}
```

### Expected behavior

```
2026-03-06T20:23:28::6021 INFO Filesystem: s3
2026-03-06T20:23:28::7097 INFO Connecting to ECMWF datastore
```

### Installed versions

```
version: 0.5.0
```

even though I installed tag v0.6.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.