nidas  v1.2-1520
Classes | Namespaces | Macros | Typedefs | Functions | Variables
Logger.cc File Reference
#include "Logger.h"
#include "ThreadSupport.h"
#include "Thread.h"
#include "UTime.h"
#include <string>
#include <cerrno>
#include <vector>
#include <map>
#include <algorithm>
#include <stdexcept>
#include <cctype>
#include <cstdlib>
#include <execinfo.h>

Classes

class  nidas::util::LoggerPrivate
 

Namespaces

 nidas
 Root namespace for the NCAR In-Situ Data Acquisition Software.
 
 nidas::util
 General utility classes. nidas::util contains classes of general utility, like Socket, Thread, etc. The classes use only the standard Unix system libraries and libstdc++, and have no dependency on other external packages such as an XML parser, or a logging package.
 

Macros

#define DEBUG_LOGGER   0
 

Typedefs

typedef vector< LogContext * > log_points_v
 
typedef map< string, LogSchemelog_schemes_t
 

Functions

static LogScheme get_scheme (const std::string &name)
 Get a scheme with the name, or return a default. More...
 
static LogSchemelookup_scheme (const std::string &name)
 This must be called while the mutex is locked, since it accesses the shared LogScheme map, and it returns a pointer which might change once the lock is released. More...
 
static void stream_backtrace (std::ostream &out)
 
static string fillError (string fmt)
 
bool parse_log_level (int &level_out, const std::string &text)
 
int nidas::util::stringToLogLevel (const std::string &slevel)
 Convert the name of a log level to its integer value. More...
 
string nidas::util::logLevelToString (int)
 Convert an integral log level to a string name. More...
 

Variables

static log_points_v log_points
 Vector of pointers to all the LogContext instances initialized so far. More...
 
static log_schemes_t log_schemes
 Map of all the known LogScheme instances. More...
 
static LogScheme current_scheme = get_scheme("")
 
static LogScheme::LogField default_fields []
 
static LogContext show_point (LOG_STATIC_CONTEXT(LOGGER_INFO),"show_log_points")
 

Macro Definition Documentation

#define DEBUG_LOGGER   0

Typedef Documentation

typedef vector<LogContext*> log_points_v
typedef map<string,LogScheme> log_schemes_t

Function Documentation

static string fillError ( string  fmt)
static
static LogScheme get_scheme ( const std::string &  name)
static
static LogScheme* lookup_scheme ( const std::string &  name)
static

This must be called while the mutex is locked, since it accesses the shared LogScheme map, and it returns a pointer which might change once the lock is released.

References log_schemes.

Referenced by get_scheme(), and nidas::util::Logger::knownScheme().

bool parse_log_level ( int &  level_out,
const std::string &  text 
)
static void stream_backtrace ( std::ostream &  out)
static

Variable Documentation

LogScheme current_scheme = get_scheme("")
static
LogScheme::LogField default_fields[]
static
Initial value:
= {
LogScheme::TimeField,
LogScheme::LevelField,
LogScheme::MessageField
}
log_points_v log_points
static
log_schemes_t log_schemes
static
LogContext show_point(LOG_STATIC_CONTEXT(LOGGER_INFO),"show_log_points")
static