Remove LogLevel::Fatal

It's never used.
This commit is contained in:
Oliver Hamlet
2025-06-08 17:58:27 +01:00
parent f3b974c90e
commit 328f1a2c15
6 changed files with 4 additions and 21 deletions
+1 -2
View File
@@ -37,8 +37,7 @@ enum struct LogLevel : unsigned int {
debug,
info,
warning,
error,
fatal
error
};
}
+1 -5
View File
@@ -23,8 +23,6 @@ extern const uint8_t LIBLOOT_LOG_LEVEL_WARNING;
extern const uint8_t LIBLOOT_LOG_LEVEL_ERROR;
extern const uint8_t LIBLOOT_LOG_LEVEL_FATAL;
void libloot_set_logging_callback(void (*callback)(uint8_t, const char*, void*),
void* context);
}
@@ -48,7 +46,7 @@ LogLevel convert(uint8_t level) {
} else if (level == LIBLOOT_LOG_LEVEL_ERROR) {
return LogLevel::error;
} else {
return LogLevel::fatal;
return LogLevel::error;
}
}
@@ -64,8 +62,6 @@ loot::rust::LogLevel convert(LogLevel level) {
return loot::rust::LogLevel::Warning;
case LogLevel::error:
return loot::rust::LogLevel::Error;
case LogLevel::fatal:
return loot::rust::LogLevel::Fatal;
default:
return loot::rust::LogLevel::Trace;
}
-6
View File
@@ -195,7 +195,6 @@ impl TryFrom<ffi::LogLevel> for libloot::LogLevel {
ffi::LogLevel::Info => Ok(libloot::LogLevel::Info),
ffi::LogLevel::Warning => Ok(libloot::LogLevel::Warning),
ffi::LogLevel::Error => Ok(libloot::LogLevel::Error),
ffi::LogLevel::Fatal => Ok(libloot::LogLevel::Fatal),
_ => Err(UnsupportedEnumValueError),
}
}
@@ -261,7 +260,6 @@ mod ffi {
Info,
Warning,
Error,
Fatal,
}
#[derive(Debug)]
@@ -712,9 +710,6 @@ pub static LIBLOOT_LOG_LEVEL_WARNING: c_uchar = 3;
#[unsafe(no_mangle)]
pub static LIBLOOT_LOG_LEVEL_ERROR: c_uchar = 4;
#[unsafe(no_mangle)]
pub static LIBLOOT_LOG_LEVEL_FATAL: c_uchar = 5;
fn to_u8(value: libloot::LogLevel) -> u8 {
match value {
libloot::LogLevel::Trace => LIBLOOT_LOG_LEVEL_TRACE,
@@ -722,7 +717,6 @@ fn to_u8(value: libloot::LogLevel) -> u8 {
libloot::LogLevel::Info => LIBLOOT_LOG_LEVEL_INFO,
libloot::LogLevel::Warning => LIBLOOT_LOG_LEVEL_WARNING,
libloot::LogLevel::Error => LIBLOOT_LOG_LEVEL_ERROR,
libloot::LogLevel::Fatal => LIBLOOT_LOG_LEVEL_FATAL,
}
}
+1 -1
View File
@@ -139,7 +139,7 @@ TEST(SetLogLevel, shouldOnlyRunTheCallbackForMessagesAtOrAboveTheGivenLevel) {
loggedMessages.push_back(std::make_pair(level, std::string(string)));
};
SetLoggingCallback(callback);
SetLogLevel(LogLevel::fatal);
SetLogLevel(LogLevel::error);
try {
CreateGameHandle(GameType::tes4, "dummy");