8 #ifndef HYPERPLATFORM_LOG_H_ 9 #define HYPERPLATFORM_LOG_H_ 11 #include <fltKernel.h> 34 #define HYPERPLATFORM_LOG_DEBUG(format, ...) \ 35 LogpPrint(kLogpLevelDebug, __FUNCTION__, (format), __VA_ARGS__) 38 #define HYPERPLATFORM_LOG_INFO(format, ...) \ 39 LogpPrint(kLogpLevelInfo, __FUNCTION__, (format), __VA_ARGS__) 42 #define HYPERPLATFORM_LOG_WARN(format, ...) \ 43 LogpPrint(kLogpLevelWarn, __FUNCTION__, (format), __VA_ARGS__) 46 #define HYPERPLATFORM_LOG_ERROR(format, ...) \ 47 LogpPrint(kLogpLevelError, __FUNCTION__, (format), __VA_ARGS__) 57 #define HYPERPLATFORM_LOG_DEBUG_SAFE(format, ...) \ 58 LogpPrint(kLogpLevelDebug | kLogpLevelOptSafe, __FUNCTION__, (format), \ 62 #define HYPERPLATFORM_LOG_INFO_SAFE(format, ...) \ 63 LogpPrint(kLogpLevelInfo | kLogpLevelOptSafe, __FUNCTION__, (format), \ 67 #define HYPERPLATFORM_LOG_WARN_SAFE(format, ...) \ 68 LogpPrint(kLogpLevelWarn | kLogpLevelOptSafe, __FUNCTION__, (format), \ 72 #define HYPERPLATFORM_LOG_ERROR_SAFE(format, ...) \ 73 LogpPrint(kLogpLevelError | kLogpLevelOptSafe, __FUNCTION__, (format), \ 143 _IRQL_requires_max_(PASSIVE_LEVEL) NTSTATUS
154 _In_ PDRIVER_OBJECT driver_object);
169 NTSTATUS
LogpPrint(_In_ ULONG level, _In_z_
const char *function_name,
170 _In_z_ _Printf_format_string_
const char *format, ...);
184 #endif // HYPERPLATFORM_LOG_H_ static const auto kLogPutLevelError
For LogInitialization(). Enables an ERROR level of logs.
void LogIrpShutdownHandler()
Terminates the log system. Should be called from an IRP_MJ_SHUTDOWN handler.
void LogRegisterReinitialization(_In_ PDRIVER_OBJECT driver_object)
Registers re-initialization.
static const auto kLogpLevelOptSafe
Save this log to buffer and not try to write to a log file.
static const auto kLogOptDisableFunctionName
For LogInitialization(). Do not log a current function name.
NTSTATUS LogInitialization(_In_ ULONG flag, _In_opt_ const wchar_t *file_path)
Initializes the log system.
void LogTermination()
Terminates the log system. Should be called from a DriverUnload routine.
static const auto kLogPutLevelDisable
For LogInitialization(). Disables all levels of logs.
static const auto kLogpLevelDebug
Bit mask for DEBUG level logs.
static const auto kLogOptDisableProcessorNumber
For LogInitialization(). Do not log a current processor number.
static const auto kLogpLevelInfo
Bit mask for INFO level logs.
static const auto kLogpLevelError
Bit mask for ERROR level logs.
static const auto kLogPutLevelWarn
For LogInitialization(). Enables ERROR and WARN levels of logs.
static const auto kLogOptDisableDbgPrint
For LogInitialization(). Do not log to debug buffer.
NTSTATUS LogpPrint(_In_ ULONG level, _In_z_ const char *function_name, _In_z_ _Printf_format_string_ const char *format,...)
Logs a message; use HYPERPLATFORM_LOG_*() macros instead.
static const auto kLogOptDisableTime
For LogInitialization(). Do not log a current time.
static const auto kLogpLevelWarn
Bit mask for WARN level logs.
static const auto kLogPutLevelInfo
For LogInitialization(). Enables ERROR, WARN and INFO levels of logs.
static const auto kLogPutLevelDebug
For LogInitialization(). Enables all levels of logs.