maliput
logger.h File Reference

Detailed Description

To log with maliput::common::logger, you should:

  maliput::log()->trace("The approximate value is ", 3.14159);

Similarly, it provides:

  maliput::log()->trace(...);
  maliput::log()->debug(...);
  maliput::log()->info(...);
  maliput::log()->warn(...);
  maliput::log()->error(...);
  maliput::log()->critical(...);

Any class that overloads operator<< for ostream can be printed without any special handling.

#include <functional>
#include <map>
#include <memory>
#include <sstream>
#include <string>
#include <vector>
#include "maliput/common/maliput_copyable.h"
#include "maliput/common/maliput_throw.h"
Include dependency graph for logger.h:
This graph shows which files directly or indirectly include this file:

Classes

class  SinkBase
 Interface of a sink to dump all log messages. More...
 
class  Sink
 Sink that uses std::cout to dump the log messages. More...
 
class  Logger
 A logger class implementation. More...
 
struct  Serialize
 Convenient functor for getting a string from a object that has serialization operator defined. More...
 

Namespaces

 maliput
 Code in this file is inspired by: https://github.com/RobotLocomotion/drake/blob/master/common/text_logging.h.
 
 maliput::common
 
 maliput::common::logger
 

Enumerations

enum  level {
  trace = 0, debug, info, warn,
  error, critical, off, unchanged
}
 Logging levels. More...
 

Variables

const std::map< std::string, logger::level > kStringToLevel
 Convenient conversion from string to level enum. More...
 
const std::map< int, std::string > kLevelToString
 Convenient conversion from level enum to string. More...
 
const std::map< int, std::string > kLevelToMessage
 Convenient conversion from level enum to message. More...