2 unstable releases
0.2.0 | Apr 18, 2022 |
---|---|
0.1.2 | Apr 18, 2022 |
0.1.1 |
|
0.1.0 |
|
#736 in WebAssembly
9KB
125 lines
worker_logger
Logger implementation for Cloudflare Workers.
Bridges the log
ecosystem to Cloudflare Worker.
Example
Initialize the logger with a string:
worker_logger::init_with_string("info");
Or initialize with a level struct:
use log::Level;
worker_logger::init_with_level(&Level::Debug);
Or with a Cloudflare Worker environment variable:
worker_logger::init_with_env(env, "LOG")?;
Features
env_logger_string
: Enables advanced logging filters. Uses the same syntax asenv_logger
. For more details, please visit https://docs.rs/env_logger/latest/env_logger/#enabling-logging.color
: Enable colored output withcolored
.
lib.rs
:
Logger implementation for Cloudflare Workers.
Bridges the log
ecosystem to Cloudflare Worker.
Example
Initialize the logger with a string:
worker_logger::init_with_string("info");
Or initialize with a level struct:
use log::Level;
worker_logger::init_with_level(&Level::Debug);
Or with a Cloudflare Worker environment variable:
worker_logger::init_with_env(env, "LOG")?;
Features
env_logger_string
: Enables advanced logging filters. Uses the same syntax asenv_logger
. For more details, please visit https://docs.rs/env_logger/latest/env_logger/#enabling-logging.color
: Enable colored output withcolored
.
Dependencies
~16–29MB
~447K SLoC