Sfoglia il codice sorgente

Add an example of flushing the logger

Resolves #33.
Sam Clements 2 anni fa
parent
commit
80c236b7aa
1 ha cambiato i file con 9 aggiunte e 0 eliminazioni
  1. 9 0
      examples/flush.rs

+ 9 - 0
examples/flush.rs

@@ -0,0 +1,9 @@
+use simple_logger::SimpleLogger;
+
+fn main() {
+    SimpleLogger::new().init().unwrap();
+
+    log::warn!("This is an example message.");
+
+    log::logger().flush();
+}