MsgLogger::MsgFormatter Class Reference
[C++ Message Logging Facility]

#include <MsgFormatter.h>

List of all members.

Public Member Functions

 MsgFormatter (const std::string &fmt="", const std::string &timefmt="")
virtual ~MsgFormatter ()
virtual void addFormat (MsgLogLevel level, const std::string &fmt)
virtual void format (const MsgLogRecord &rec, std::ostream &out)

Static Public Member Functions

static void addGlobalFormat (const std::string &fmt)
static void addGlobalFormat (MsgLogLevel level, const std::string &fmt)

Protected Member Functions

virtual const std::string & getFormat (MsgLogLevel level) const


Detailed Description

The class which does message formating to show the message in the human-readable format. In principle you can inherit this class and override some methods, but this implementation is already sufficiently generic and can be controlled completely via the format strings.

This software was developed for the BaBar collaboration. If you use all or part of it, please give an appropriate acknowledgement.

Copyright (C) 2005 SLAC

See also:
MsgHandler
Version:
Id
MsgFormatter.h 2700 2011-12-09 21:52:07Z salnikov@SLAC.STANFORD.EDU
Author:
Andy Salnikov

Definition at line 78 of file MsgFormatter.h.


Constructor & Destructor Documentation

MsgLogger::MsgFormatter::MsgFormatter ( const std::string &  fmt = "",
const std::string &  timefmt = "" 
)

Definition at line 100 of file MsgFormatter.cpp.

References initFmtMap().

MsgLogger::MsgFormatter::~MsgFormatter (  )  [virtual]

Definition at line 116 of file MsgFormatter.cpp.


Member Function Documentation

void MsgLogger::MsgFormatter::addFormat ( MsgLogLevel  level,
const std::string &  fmt 
) [virtual]

Definition at line 135 of file MsgFormatter.cpp.

References MsgLogger::MsgLogLevel::code().

void MsgLogger::MsgFormatter::addGlobalFormat ( MsgLogLevel  level,
const std::string &  fmt 
) [static]

Definition at line 128 of file MsgFormatter.cpp.

References MsgLogger::MsgLogLevel::code(), and s_appFmtMap.

void MsgLogger::MsgFormatter::addGlobalFormat ( const std::string &  fmt  )  [static]

Definition at line 122 of file MsgFormatter.cpp.

References MsgLogger::MsgLogLevel::LAST_LEVEL, and s_appFmtMap.

Referenced by psana::PSAnaApp::preRunApp().

void MsgLogger::MsgFormatter::format ( const MsgLogRecord rec,
std::ostream &  out 
) [virtual]

Definition at line 142 of file MsgFormatter.cpp.

References MsgLogger::MsgLogRecord::fileName(), formattedTime(), getFormat(), MsgLogger::MsgLogRecord::level(), MsgLogger::MsgLogLevel::level3(), MsgLogger::MsgLogLevel::levelLetter(), MsgLogger::MsgLogRecord::lineNum(), MsgLogger::MsgLogRecord::logger(), and MsgLogger::MsgLogRecord::msgbuf().

Referenced by MsgLogger::MsgHandlerStdStreams::log().

const std::string & MsgLogger::MsgFormatter::getFormat ( MsgLogLevel  level  )  const [protected, virtual]

Definition at line 233 of file MsgFormatter.cpp.

References MsgLogger::MsgLogLevel::code(), s_appFmtMap, s_defFmt, and s_envFmtMap.

Referenced by format().


The documentation for this class was generated from the following files:
Generated on 19 Dec 2016 for PSANAclasses by  doxygen 1.4.7