Skip to content
Snippets Groups Projects
Commit e451ba9c authored by Georgy Moshkin's avatar Georgy Moshkin :speech_balloon:
Browse files

fix: use tarantool::log::current_level instead of a custom static variable

parent 3688323e
No related branches found
No related tags found
1 merge request!1023feat: rework migration file parsing
......@@ -2,13 +2,9 @@ use ::tarantool::log::{say, SayLevel};
use once_cell::sync::Lazy;
use std::{collections::HashMap, ptr};
static mut LOG_LEVEL: SayLevel = SayLevel::Info;
#[inline(always)]
pub fn set_log_level(lvl: SayLevel) {
// SAFETY: Here and onward, globals are used in single thread.
unsafe {
LOG_LEVEL = lvl;
}
tarantool::log::set_current_level(lvl)
}
/// For user experience reasons we do some log messages enhancements (we add
......@@ -150,7 +146,7 @@ impl slog::Drain for Drain {
// It's hardcoded in Cargo.toml dependency features
// In runtime it's managed by tarantool box.cfg.log_level
let level = slog_level_to_say_level(record.level());
if level > unsafe { LOG_LEVEL } {
if level > tarantool::log::current_level() {
return Ok(());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment