mirror of
https://github.com/touchHLE/rust-sdl2.git
synced 2026-01-31 01:25:23 +01:00
Introduced Logging priority based loggin functions
which call the generic logging function
This commit is contained in:
@@ -122,6 +122,42 @@ pub fn log(message: &str) {
|
||||
}
|
||||
}
|
||||
|
||||
/// Log function which takes as priority CRITICAL and category APPLICATION
|
||||
#[doc(alias = "SDL_LogCritial")]
|
||||
pub fn log_critical(message: &str) {
|
||||
log_with_category(message, Category::Application, Priority::Critical);
|
||||
}
|
||||
|
||||
/// Log function which takes as priority DEBUG and category APPLICATION
|
||||
#[doc(alias = "SDL_LogDebug")]
|
||||
pub fn log_debug(message: &str) {
|
||||
log_with_category(message, Category::Application, Priority::Debug);
|
||||
}
|
||||
|
||||
/// Log function which takes as priority ERROR and category APPLICATION
|
||||
#[doc(alias = "SDL_LogError")]
|
||||
pub fn log_error(message: &str) {
|
||||
log_with_category(message, Category::Application, Priority::Error);
|
||||
}
|
||||
|
||||
/// Log function which takes as priority INFO and category APPLICATION
|
||||
#[doc(alias = "SDL_LogInfo")]
|
||||
pub fn log_info(message: &str) {
|
||||
log_with_category(message, Category::Application, Priority::Info);
|
||||
}
|
||||
|
||||
/// Log function which takes as priority VERBOSE and category APPLICATION
|
||||
#[doc(alias = "SDL_LogVerbose")]
|
||||
pub fn log_verbose(message: &str) {
|
||||
log_with_category(message, Category::Application, Priority::Verbose);
|
||||
}
|
||||
|
||||
/// Log function which takes as priority WARN and category APPLICATION
|
||||
#[doc(alias = "SDL_LogWarn")]
|
||||
pub fn log_warn(message: &str) {
|
||||
log_with_category(message, Category::Application, Priority::Warn);
|
||||
}
|
||||
|
||||
/// Log function where Category and Priority can be specified
|
||||
pub fn log_with_category(message: &str, category: Category, priority: Priority) {
|
||||
let message = message.replace('%', "%%");
|
||||
|
||||
Reference in New Issue
Block a user