#dioxus #log #logging

dioxus-logger

A logging utility to provide a standard interface whether you're targetting web, desktop, or mobile

5 unstable releases

Uses new Rust 2021

0.3.0 Nov 10, 2022
0.2.0 Nov 9, 2022
0.1.2 Nov 5, 2022
0.1.1 Nov 5, 2022
0.1.0 Nov 5, 2022

#190 in Debugging

Download history 57/week @ 2022-11-02 56/week @ 2022-11-09 7/week @ 2022-11-16 3/week @ 2022-11-23

123 downloads per month

MIT license

7KB
61 lines

📡 Dioxus Logger 🛰️

A logging utility to provide a standard interface whether you're targetting web, desktop, or mobile with Dioxus.


dioxus-logger is a (planned-to-be) feature-rich logger for Dioxus that uses the log crate to provide a standard interface for all your logging needs.

Current & Planned Features

  • stdio logging (Web, Desktop) - Mobile to come
  • Custom log format - Basic Implementation Finished
  • Timestamps
  • Sending logs over HTTP to an API
  • Logging to a file
  • Logging to Sentry?

This library is under development. Expect breaking changes.

use dioxus::prelude::*;
use log::{LevelFilter, info};

fn main() {
  dioxus_logger::init(LevelFilter::Info).expect("failed to init logger");
  dioxus::web::launch(app);
}

fn app(cx: Scope) -> Element {
  info!("app component rendered!");
  rsx!(cx, p { "Hello, Dioxus!" })
}

Platform Support

Dioxus logger will eventually support every target that Dioxus does. Currently only web and desktop platforms are supported.

Installation

You can add dioxus-logger to your application by adding it to your dependencies.

[dependencies]
dioxus-logger = "x.x.x"

License

This project is licensed under the MIT license.

Every contribution intentionally submitted for inclusion in dioxus-logger by you, shall be licensed as MIT, without any additional terms or conditions.

Dependencies

~6–8.5MB
~160K SLoC