|
BDE 4.14.0 Production release
|
#include <bsls_log.h>
Public Types | |
| typedef void(* | LogMessageHandler) (bsls::LogSeverity::Enum severity, const char *file, int line, const char *message) |
Static Public Member Functions | |
| static void | logFormattedMessage (bsls::LogSeverity::Enum severity, const char *file, int line, const char *format,...) |
| static void | logMessage (bsls::LogSeverity::Enum severity, const char *file, int line, const char *message) |
| static Log::LogMessageHandler | logMessageHandler () |
| Return the address of the currently installed log message handler. | |
| static void | platformDefaultMessageHandler (bsls::LogSeverity::Enum severity, const char *file, int line, const char *message) |
| static void | setLogMessageHandler (Log::LogMessageHandler handler) |
Install the specified handler as the current log message handler. | |
| static void | setSeverityThreshold (bsls::LogSeverity::Enum severity) |
| static bsls::LogSeverity::Enum | severityThreshold () |
| static void | stderrMessageHandler (bsls::LogSeverity::Enum severity, const char *file, int line, const char *message) |
| static void | stdoutMessageHandler (bsls::LogSeverity::Enum severity, const char *file, int line, const char *message) |
This class serves as a namespace containing a suite of utility functions that allow low-level code to write log messages to a configurable, globally controlled destination.
See bsls_log
| typedef void(* bsls::Log::LogMessageHandler) (bsls::LogSeverity::Enum severity, const char *file, int line, const char *message) |
The LogMessageHandler typedef represents a type of function that handles log messages in an unspecified way (e.g., by writing the log message to an output stream or to a file). Because they can be called concurrently from multiple threads, log message handlers must be thread-safe. While installed, handlers must exhibit only defined behavior if the specified file is a null-terminated string, the specified line is not negative, and the specified message is a null-terminated string.
|
static |
If the specified severity is at least as severe as severityThrehold, invoke the currently installed log message handler with severity and the specified file and line, as well as a message string created by calling sprintf on the specified format with the specified variadic arguments; otherwise (if severity is less severe), this operation has no effect. The behavior is undefined unless 0 <= line, and format is a valid sprintf format specification for the supplied variadic arguments.
|
inlinestatic |
If the specified severity is at least as severe as severityThreshold, invoke the currently installed log message handler with severity, as well as the specified file, line, and message; otherwise (if severity is less severe), this operation has no effect. The behavior is undefined unless 0 <= line.
|
inlinestatic |
|
static |
Write, to a platform-specific destination, a string composed of the specified severity, file name, line number, and message. On non-Windows systems, write the log record to the stderr output stream. On Windows systems: If the current process is running in console mode, write the log record to the stderr output stream. If the current process is running in non-console mode, write the log record to the Windows process debugger. The behavior is undefined unless 0 <= line. Note that this function is used as the default log message handler. Also note that this function will write the message irrespective of the current severityThreshold.
|
inlinestatic |
|
inlinestatic |
Set the severity threshold at which log records are written by logMessage and logFormattedMessage to the specified severity.
|
inlinestatic |
Return the currently configured severity threshold at or above which records are written by logMessage and logFormattedMessage.
|
static |
Write, to the stderr output stream, a string composed of the specified severity, file name, line number, and the message. The behavior is undefined unless 0 <= line. Note that this function provides an implementation of the LogMessageHandler function prototype, and will write the message irrespective of the current severityThreshold.
|
static |
Write, to the stdout output stream, a string composed of the specified severity, file name, line number, and the message. The behavior is undefined unless 0 <= line. Note that this function provides an implementation of the LogMessageHandler function prototype, and will write the message irrespective of the current severityThreshold.