-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tweak security logging module. Add security_error macro.
- Loading branch information
Showing
1 changed file
with
11 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)*);} | ||
) | ||
} |