iqlusioninc / abscissa

Application microframework with command-line option parsing, configuration, error handling, logging, and shell interactions
Apache License 2.0
570 stars 39 forks source link

Redirecting status logging message outputs #402

Open tomtau opened 3 years ago

tomtau commented 3 years ago

Not sure if duplicate of https://github.com/iqlusioninc/abscissa/issues/344

with tracing, one can implement a subscriber that will receive the log events -- e.g. instead of using standard output, one can use "console.log" in WASM: https://crates.io/crates/tracing-wasm

It'll be good if this is possible with status_*!(..., ...) logging macros too. Currently, the status messages seem to use the Terminal component and it seems external applications can't modify terminal streams: https://github.com/iqlusioninc/abscissa/blob/develop/core/src/terminal.rs#L14

tony-iqlusion commented 3 years ago

In general this is an important concern: all of the current logging macros use the log facade, and this has never been updated.

I agree all of the logging macros need to be revisited and updated to support tracing.

JRAndreassen commented 3 years ago

A logging facility like tokio tracing would be optimal. From my perspective (Windows service) a local logging to file with rotation controllable from the config file (location, rotation and format) would be great.

tony-iqlusion commented 3 years ago

@JRAndreassen Abscissa's logging subsystem has been based on tracing since Abscissa v0.5 released a year ago.

However, the logging macros use tracing via its log facade.

JRAndreassen commented 3 years ago

@tony-iqlusion : Awesome... The control of the output via the config is key for my environment. Thanks JR