Skip to content

Commit

Permalink
Tweak security logging module. Add security_error macro.
Browse files Browse the repository at this point in the history
  • Loading branch information
ohuopio committed Mar 7, 2024
1 parent 3cf33aa commit 5768ad6
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/security/logging.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
// A macro for logging of security events.
// Currently just creates a normal info-level log entry.
// However, this dedicated macro is intended as a reminder that security-related
// Macros for logging security events.
// Currently these just create a normal log entry,
// but they're intended as a reminder that security-related
// logging should be handled with special care (by a security-logging-plugin in
// the future?) So it acts as a placeholder for more to come.
// the future?) So they act as a placeholder for more to come.
#[macro_export]
macro_rules! security_info {
($($arg:tt)*) => (
{log::info!($($arg)*);}
)
}

// Same as above, just with warn-level
#[macro_export]
macro_rules! security_warn {
($($arg:tt)*) => (
{log::warn!($($arg)*);}
)
}

#[macro_export]
macro_rules! security_error {
($($arg:tt)*) => (
{log::error!($($arg)*);}
)
}

0 comments on commit 5768ad6

Please sign in to comment.