https://github.com/yewstack/web_logger
Rust Logger for Web Browsers
https://github.com/yewstack/web_logger
wasm
Last synced: 14 days ago
JSON representation
Rust Logger for Web Browsers
- Host: GitHub
- URL: https://github.com/yewstack/web_logger
- Owner: yewstack
- Created: 2018-05-10T21:31:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-05-02T18:12:19.000Z (over 5 years ago)
- Last Synced: 2025-08-31T16:40:32.572Z (4 months ago)
- Topics: wasm
- Language: Rust
- Size: 5.86 KB
- Stars: 20
- Watchers: 4
- Forks: 6
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# web_logger
Implements a logger that can be used in web browsers.
## Usage
### In libraries
Not required. Libraries should use the [`log`](https://doc.rust-lang.org/log) crate instead.
### In executables
It must be added along with `log` to the project dependencies:
```toml
[dependencies]
log = "0.4"
web_logger = "0.2"
```
`web_logger` must be initialized as early as possible in the project.
After it's initialized, you can use the `log` macros to do actual logging.
```rust
#[macro_use]
extern crate log;
extern crate web_logger;
fn main() {
web_logger::init();
info!("starting up");
// ...
}
```