Skip to content

Commit

Permalink
feat: allow pretty, ndjson, wasm loggers to be started directly (#23)
Browse files Browse the repository at this point in the history
One may want just one of these, allow a user to pick directly.

Closes: #23
  • Loading branch information
Fishrock123 authored Apr 5, 2022
1 parent e2e59a2 commit 2319199
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ndjson.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::io::{self, StdoutLock, Write};
use std::time;

/// Start logging.
pub(crate) fn start(level: LevelFilter) {
pub fn start(level: LevelFilter) {
let logger = Box::new(Logger {});
log::set_boxed_logger(logger).expect("Could not start logging");
log::set_max_level(level);
Expand Down
2 changes: 1 addition & 1 deletion src/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const GREEN: &str = "\x1b[32m";
const YELLOW: &str = "\x1b[33m";

/// Start logging.
pub(crate) fn start(level: LevelFilter) {
pub fn start(level: LevelFilter) {
let logger = Box::new(Logger {});
log::set_boxed_logger(logger).expect("Could not start logging");
log::set_max_level(level);
Expand Down
2 changes: 1 addition & 1 deletion src/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use wasm_bindgen::prelude::*;
use std::collections::HashMap;

/// Start logging.
pub(crate) fn start(level: LevelFilter) {
pub fn start(level: LevelFilter) {
let logger = Box::new(Logger {});
log::set_boxed_logger(logger).expect("Could not start logging");
log::set_max_level(level);
Expand Down

0 comments on commit 2319199

Please sign in to comment.