Skip to content

Commit 6532a8c

Browse files
committed
log: Convert statics to constants
1 parent a64bb66 commit 6532a8c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/liblog/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,10 @@ mod directive;
188188

189189
/// Maximum logging level of a module that can be specified. Common logging
190190
/// levels are found in the DEBUG/INFO/WARN/ERROR constants.
191-
pub static MAX_LOG_LEVEL: u32 = 255;
191+
pub const MAX_LOG_LEVEL: u32 = 255;
192192

193193
/// The default logging level of a crate if no other is specified.
194-
static DEFAULT_LOG_LEVEL: u32 = 1;
194+
const DEFAULT_LOG_LEVEL: u32 = 1;
195195

196196
/// An unsafe constant that is the maximum logging level of any module
197197
/// specified. This is the first line of defense to determining whether a
@@ -205,13 +205,13 @@ static mut DIRECTIVES: *const Vec<directive::LogDirective> =
205205
static mut FILTER: *const Regex = 0 as *const _;
206206

207207
/// Debug log level
208-
pub static DEBUG: u32 = 4;
208+
pub const DEBUG: u32 = 4;
209209
/// Info log level
210-
pub static INFO: u32 = 3;
210+
pub const INFO: u32 = 3;
211211
/// Warn log level
212-
pub static WARN: u32 = 2;
212+
pub const WARN: u32 = 2;
213213
/// Error log level
214-
pub static ERROR: u32 = 1;
214+
pub const ERROR: u32 = 1;
215215

216216
local_data_key!(local_logger: Box<Logger + Send>)
217217

0 commit comments

Comments
 (0)