ros::console Namespace Reference

Namespaces

namespace  levels

Classes

struct  FileToken
class  FilterBase
 Base-class for filters. Filters allow full user-defined control over whether or not a message should print. The ROS_X_FILTER... macros provide the filtering functionality. More...
struct  FilterParams
 Parameter structure passed to FilterBase::isEnabled(...);. Includes both input and output parameters. More...
struct  FixedMapToken
struct  FixedToken
struct  Formatter
struct  FunctionToken
struct  LineToken
struct  LoggerToken
struct  LogLocation
 Internal. More...
struct  MessageToken
struct  PlaceHolderToken
class  ROSConsoleStdioAppender
struct  SeverityToken
class  StaticInit
struct  ThreadToken
struct  TimeToken
struct  Token

Typedefs

typedef levels::Level Level
typedef std::map< std::string,
std::string > 
M_string
typedef boost::shared_ptr< TokenTokenPtr
typedef std::vector
< LogLocation * > 
V_LogLocation
typedef std::vector< TokenPtrV_Token

Functions

void checkLogLocationEnabled (LogLocation *loc)
 Internal.
void checkLogLocationEnabledNoLock (LogLocation *loc)
TokenPtr createTokenFromType (const std::string &type)
void do_initialize ()
 For internal use only. Does the actual initialization of the rosconsole system. Should only be called once.
void formatToBuffer (boost::shared_array< char > &buffer, size_t &buffer_size, const char *fmt,...)
std::string formatToString (const char *fmt,...)
static boost::shared_array< char > g_print_buffer (new char[INITIAL_BUFFER_SIZE])
void initialize ()
 Don't call this directly. Performs any required initialization/configuration. Happens automatically when using the macro API.
void initializeLogLocation (LogLocation *loc, const std::string &name, Level level)
 Internal.
void notifyLoggerLevelsChanged ()
 Tells the system that a logger's level has changed.
void void print (FilterBase *filter, log4cxx::Logger *logger, Level level, const std::stringstream &str, const char *file, int line, const char *function)
void print (FilterBase *filter, log4cxx::Logger *logger, Level level, const char *file, int line, const char *function, const char *fmt,...) ROSCONSOLE_PRINTF_ATTRIBUTE(7
 Don't call this directly. Use the ROS_LOG() macro instead.
void registerLogLocation (LogLocation *loc)
 Registers a logging location with the system.
void setFixedFilterToken (const std::string &key, const std::string &val)
void setLogLocationLevel (LogLocation *loc, Level level)
 Internal.
void shutdown ()
void vformatToBuffer (boost::shared_array< char > &buffer, size_t &buffer_size, const char *fmt, va_list args)

Variables

M_string g_extra_fixed_tokens
const char * g_format_string = "[${severity}] [${time}]: ${message}"
Formatter g_formatter
boost::mutex g_init_mutex
bool g_initialized = false
 Only exported because the macros need it. Do not use directly.
log4cxx::LevelPtr g_level_lookup []
boost::mutex g_locations_mutex
V_LogLocation g_log_locations
static size_t g_print_buffer_size = INITIAL_BUFFER_SIZE
static boost::mutex g_print_mutex
static boost::thread::id g_printing_thread_id
bool g_shutting_down = false
StaticInit g_static_init

Typedef Documentation

Definition at line 92 of file console.h.

typedef std::map<std::string, std::string> ros::console::M_string

Definition at line 63 of file rosconsole.cpp.

typedef boost::shared_ptr<Token> ros::console::TokenPtr

Definition at line 60 of file rosconsole.cpp.

Definition at line 592 of file rosconsole.cpp.

typedef std::vector<TokenPtr> ros::console::V_Token

Definition at line 61 of file rosconsole.cpp.


Function Documentation

void ros::console::checkLogLocationEnabled ( LogLocation *  loc  ) 

Internal.

Definition at line 632 of file rosconsole.cpp.

void ros::console::checkLogLocationEnabledNoLock ( LogLocation *  loc  ) 

Definition at line 602 of file rosconsole.cpp.

TokenPtr ros::console::createTokenFromType ( const std::string &  type  ) 

Definition at line 211 of file rosconsole.cpp.

void ros::console::do_initialize (  ) 

For internal use only. Does the actual initialization of the rosconsole system. Should only be called once.

Definition at line 364 of file rosconsole.cpp.

void ros::console::formatToBuffer ( boost::shared_array< char > &  buffer,
size_t &  buffer_size,
const char *  fmt,
  ... 
)

Definition at line 434 of file rosconsole.cpp.

std::string ros::console::formatToString ( const char *  fmt,
  ... 
)

Definition at line 444 of file rosconsole.cpp.

static boost::shared_array<char> ros::console::g_print_buffer ( new  char[INITIAL_BUFFER_SIZE]  )  [static]
void ros::console::initialize (  ) 

Don't call this directly. Performs any required initialization/configuration. Happens automatically when using the macro API.

If you're going to be using log4cxx or any of the ros::console functions, and need the system to be initialized, use the ROSCONSOLE_AUTOINIT macro.

Definition at line 403 of file rosconsole.cpp.

void ros::console::initializeLogLocation ( LogLocation *  loc,
const std::string &  name,
Level  level 
)

Internal.

Definition at line 607 of file rosconsole.cpp.

void ros::console::notifyLoggerLevelsChanged (  ) 

Tells the system that a logger's level has changed.

This must be called if a log4cxx::Logger's level has been changed in the middle of an application run. Because of the way the static guard for enablement works, if a logger's level is changed and this function is not called, only logging statements which are first hit *after* the change will be correct wrt that logger.

Definition at line 638 of file rosconsole.cpp.

void ros::console::print ( FilterBase *  filter,
log4cxx::Logger *  logger,
Level  level,
const std::stringstream &  str,
const char *  file,
int  line,
const char *  function 
)

Definition at line 532 of file rosconsole.cpp.

void ros::console::print ( FilterBase *  filter,
log4cxx::Logger *  logger,
Level  level,
const char *  file,
int  line,
const char *  function,
const char *  fmt,
  ... 
)

Don't call this directly. Use the ROS_LOG() macro instead.

Parameters:
level Logging level
file File this logging statement is from (usually generated with __FILE__)
line Line of code this logging statement is from (usually generated with __LINE__)
fmt Format string

Definition at line 465 of file rosconsole.cpp.

void ros::console::registerLogLocation ( LogLocation *  loc  ) 

Registers a logging location with the system.

This is used for the case where a logger's verbosity level changes, and we need to reset the enabled status of all the logging statements.

Parameters:
loc The location to add

Definition at line 595 of file rosconsole.cpp.

void ros::console::setFixedFilterToken ( const std::string &  key,
const std::string &  val 
)

Definition at line 66 of file rosconsole.cpp.

void ros::console::setLogLocationLevel ( LogLocation *  loc,
Level  level 
)

Internal.

Definition at line 626 of file rosconsole.cpp.

void ros::console::shutdown (  ) 

Definition at line 414 of file rosconsole.cpp.

void ros::console::vformatToBuffer ( boost::shared_array< char > &  buffer,
size_t &  buffer_size,
const char *  fmt,
va_list  args 
)

Definition at line 419 of file rosconsole.cpp.


Variable Documentation

Definition at line 64 of file rosconsole.cpp.

const char* ros::console::g_format_string = "[${severity}] [${time}]: ${message}"

Definition at line 54 of file rosconsole.cpp.

Definition at line 337 of file rosconsole.cpp.

Definition at line 38 of file rosconsole.cpp.

Only exported because the macros need it. Do not use directly.

Definition at line 36 of file rosconsole.cpp.

Initial value:
{
  log4cxx::Level::getDebug(),
  log4cxx::Level::getInfo(),
  log4cxx::Level::getWarn(),
  log4cxx::Level::getError(),
  log4cxx::Level::getFatal(),
}

Definition at line 40 of file rosconsole.cpp.

Definition at line 594 of file rosconsole.cpp.

Definition at line 593 of file rosconsole.cpp.

size_t ros::console::g_print_buffer_size = INITIAL_BUFFER_SIZE [static]

Definition at line 462 of file rosconsole.cpp.

boost::mutex ros::console::g_print_mutex [static]

Definition at line 460 of file rosconsole.cpp.

boost::thread::id ros::console::g_printing_thread_id [static]

Definition at line 463 of file rosconsole.cpp.

Definition at line 37 of file rosconsole.cpp.

Definition at line 659 of file rosconsole.cpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines


rosconsole
Author(s): Josh Faust
autogenerated on Fri Jan 11 09:09:24 2013