Quick Links:

bal | bbl | bdl | bsl

Namespaces

Component bsls_logseverity
[Package bsls]

Enumerate a set of logging severity levels. More...

Namespaces

namespace  bsls

Detailed Description

Outline
Purpose:
Enumerate a set of logging severity levels.
Classes:
bsls::LogSeverity namespace for enumerating logging severity levels
See also:
Component bsls_log
Description:
This component provides a namespace for the enum type bsls::LogSeverity::Enum, which enumerates a set of severity levels used for logging with bsls_log.
Enumerators:
  Name          Description
  -----------   -------------------------------------------------------------
  e_FATAL       A severity appropriate for log messages accompanying a fatal
                event (i.e., one that will cause a *crash*).

  e_ERROR       A severity appropriate for log messages accompanying an
                unexpected error (i.e., one that will cause incorrect
                behavior).

  e_WARN        A severity appropriate for log messages accompanying an
                event that may indicate a problem.

  e_INFO        A severity appropriate for log messages providing informative
                status about the running process.

  e_DEBUG       A severity appropriate for log messages providing information
                useful for debugging.

  e_TRACE       A severity appropriate for log messages providing detailed
                trace information.
Usage:
This section illustrates intended use of this component.
Example 1: Basic Syntax:
The following snippets of code provide a simple illustration of using bsls::LogSeverity.
First, we create a variable value of type bsls::LogSeverity::Enum and initialize it with the enumerator value bsls::LogSeverity::e_DEBUG:
  bsls::LogSeverity::Enum value = bsls::LogSeverity::e_DEBUG;
Now, we store the address of its ASCII representation in a pointer variable, asciiValue, of type const char *:
  const char *asciiValue = bsls::LogSeverity::toAscii(value);
Finally, we verify the value of asciiValue:
  assert(0 == strcmp(asciiValue, "DEBUG"));