瀏覽代碼

Clarify language around method order.

Sam Clements 2 年之前
父節點
當前提交
2b029aa7d5
共有 1 個文件被更改,包括 7 次插入2 次删除
  1. 7 2
      src/lib.rs

+ 7 - 2
src/lib.rs

@@ -146,8 +146,10 @@ impl SimpleLogger {
     /// Simulates env_logger behavior, which enables the user to choose log
     /// level by setting a `RUST_LOG` environment variable. This will use
     /// the default level set by [`with_level`] if `RUST_LOG` is not set or
-    /// can't be parsed as a standard log level. 
-    /// (if calling `with_level`, call this after that, otherwise it will have no effect)
+    /// can't be parsed as a standard log level.
+    ///
+    /// This must be called after [`with_level`]. If called before
+    /// [`with_level`], it will have no effect.
     ///
     /// [`with_level`]: #method.with_level
     #[must_use = "You must call init() to begin logging"]
@@ -166,6 +168,9 @@ impl SimpleLogger {
     ///
     /// You can override the default level for specific modules and their sub-modules using [`with_module_level`]
     ///
+    /// This must be called before [`env`]. If called after [`env`], it will override the value loaded from the environment.
+    ///
+    /// [`env`]: #method.env
     /// [`with_module_level`]: #method.with_module_level
     #[must_use = "You must call init() to begin logging"]
     pub fn with_level(mut self, level: LevelFilter) -> SimpleLogger {