Project: engagement_recognition

License: BSD

Dependencies:

Used by: None

All Packages

ConsoleLogger Class Reference

#include <console_logger.h>

List of all members.

Public Member Functions

void blue (const char *str, va_list args)
void brightBlue (const char *str, va_list args)
void brightCyan (const char *str, va_list args)
void brightGreen (const char *str, va_list args)
void brightPurple (const char *str, va_list args)
void brightRed (const char *str, va_list args)
void brightYellow (const char *str, va_list args)
 ConsoleLogger (ConsoleLogger *logger)
 ConsoleLogger (ConsoleLogger *logger, std::string prefix, int color)
 ConsoleLogger (std::string prefix, int color)
 ConsoleLogger (ConsoleLogger *logger, std::string prefix)
 ConsoleLogger (std::string prefix)
 ConsoleLogger ()
void cyan (const char *str, va_list args)
void debug (int level, const char *str, va_list args)
void error (const char *str, va_list args)
void fatal (const char *str, va_list args)
const char * getPrefix ()
void green (const char *str, va_list args)
void info (const char *str, va_list args)
void purple (const char *str, va_list args)
void red (const char *str, va_list args)
void warn (const char *str, va_list args)
void yellow (const char *str, va_list args)

Private Member Functions

void createPrefix (std::string prefix, int color)

Private Attributes

std::string prefix_
int verbosity_

Static Private Attributes

static std::string BLUE = "34m"
static std::string BRIGHT_BLUE = "94m"
static std::string BRIGHT_CYAN = "96m"
static std::string BRIGHT_GREEN = "92m"
static std::string BRIGHT_PURPLE = "95m"
static std::string BRIGHT_RED = "91m"
static std::string BRIGHT_YELLOW = "93m"
static std::string CYAN = "36m"
static std::string DEFAULT = "0m"
static std::string end_color = "\033[0m"
static std::string GREEN = "32m"
static std::string PURPLE = "35m"
static std::string RED = "31m"
static std::string start_color = "\033["
static std::string YELLOW = "33m"

Detailed Description

The ConsoleLogger class encapsulates the concept of logging output to the console through ROS. It provides an easy way to add a prefix to a logged message and change the color of the prefix, and log any version of a print statement to the console.

Author:
Brett Ponsler (bponsler (at) wpi (dot) edu)

Definition at line 50 of file console_logger.h.


Constructor & Destructor Documentation

ConsoleLogger::ConsoleLogger (  ) 

Default constructor for the ConsoleLogger.

Definition at line 59 of file console_logger.cpp.

ConsoleLogger::ConsoleLogger ( std::string  prefix  ) 

Create a ConsoleLogger with a prefix.

Parameters:
prefix The prefix

Definition at line 65 of file console_logger.cpp.

ConsoleLogger::ConsoleLogger ( ConsoleLogger logger,
std::string  prefix 
)

Create a ConsoleLogger using a Logger and a prefix.

Parameters:
logger The logger
area The prefix

Definition at line 71 of file console_logger.cpp.

ConsoleLogger::ConsoleLogger ( std::string  prefix,
int  color 
)

Create a ConsoleLogger with a prefix and a color.

Parameters:
prefix The prefix
color The color

Definition at line 81 of file console_logger.cpp.

ConsoleLogger::ConsoleLogger ( ConsoleLogger logger,
std::string  prefix,
int  color 
)

Create a ConsoleLogger using a Logger, a prefix, and a color.

Parameters:
logger The logger
area The prefix
color The color

Definition at line 88 of file console_logger.cpp.

ConsoleLogger::ConsoleLogger ( ConsoleLogger logger  ) 

Create a ConsoleLogger using a Logger.

Parameters:
logger The logger

Definition at line 101 of file console_logger.cpp.


Member Function Documentation

void ConsoleLogger::blue ( const char *  str,
va_list  args 
)

Log a Blue Info statement to the console.

Parameters:
str The string to log

Definition at line 276 of file console_logger.cpp.

void ConsoleLogger::brightBlue ( const char *  str,
va_list  args 
)

Log a Bright Blue Info statement to the console.

Parameters:
str The string to log

Definition at line 378 of file console_logger.cpp.

void ConsoleLogger::brightCyan ( const char *  str,
va_list  args 
)

Log a Bright Cyan Info statement to the console.

Parameters:
str The string to log

Definition at line 412 of file console_logger.cpp.

void ConsoleLogger::brightGreen ( const char *  str,
va_list  args 
)

Log a Bright Green Info statement to the console.

Parameters:
str The string to log

Definition at line 344 of file console_logger.cpp.

void ConsoleLogger::brightPurple ( const char *  str,
va_list  args 
)

Log a Bright Purple Info statement to the console.

Parameters:
str The string to log

Definition at line 395 of file console_logger.cpp.

void ConsoleLogger::brightRed ( const char *  str,
va_list  args 
)

Log a Bright Red Info statement to the console.

Parameters:
str The string to log

Definition at line 327 of file console_logger.cpp.

void ConsoleLogger::brightYellow ( const char *  str,
va_list  args 
)

Log a Bright Yellow Info statement to the console.

Parameters:
str The string to log

Definition at line 361 of file console_logger.cpp.

void ConsoleLogger::createPrefix ( std::string  prefix,
int  color 
) [private]

Create the prefix for this ConsoleLogger.

Parameters:
prefix The prefix
color The color

Definition at line 114 of file console_logger.cpp.

void ConsoleLogger::cyan ( const char *  str,
va_list  args 
)

Log a Cyan Info statement to the console.

Parameters:
str The string to log

Definition at line 310 of file console_logger.cpp.

void ConsoleLogger::debug ( int  level,
const char *  str,
va_list  args 
)

Log a Debug statement to the console.

Parameters:
level The verbosity level for this statement
str The string to log

Definition at line 136 of file console_logger.cpp.

void ConsoleLogger::error ( const char *  str,
va_list  args 
)

Log an Error statement to the console.

Parameters:
str The string to log

Definition at line 191 of file console_logger.cpp.

void ConsoleLogger::fatal ( const char *  str,
va_list  args 
)

Log a Fatal statement to the console.

Parameters:
str The string to log

Definition at line 208 of file console_logger.cpp.

const char * ConsoleLogger::getPrefix (  ) 

Return the prefix for this ConsoleLogger.

Returns:
The prefix

Definition at line 131 of file console_logger.cpp.

void ConsoleLogger::green ( const char *  str,
va_list  args 
)

Log a Green Info statement to the console.

Parameters:
str The string to log

Definition at line 242 of file console_logger.cpp.

void ConsoleLogger::info ( const char *  str,
va_list  args 
)

Log an Info statement to the console.

Parameters:
str The string to log

Definition at line 157 of file console_logger.cpp.

void ConsoleLogger::purple ( const char *  str,
va_list  args 
)

Log a Purple Info statement to the console.

Parameters:
str The string to log

Definition at line 293 of file console_logger.cpp.

void ConsoleLogger::red ( const char *  str,
va_list  args 
)

Log a Red Info statement to the console.

Parameters:
str The string to log

Definition at line 225 of file console_logger.cpp.

void ConsoleLogger::warn ( const char *  str,
va_list  args 
)

Log a Warning statement to the console.

Parameters:
str The string to log

Definition at line 174 of file console_logger.cpp.

void ConsoleLogger::yellow ( const char *  str,
va_list  args 
)

Log a Yellow Info statement to the console.

Parameters:
str The string to log

Definition at line 259 of file console_logger.cpp.


Member Data Documentation

std::string ConsoleLogger::BLUE = "34m" [static, private]

The color blue.

Definition at line 70 of file console_logger.h.

std::string ConsoleLogger::BRIGHT_BLUE = "94m" [static, private]

The bright color blue.

Definition at line 83 of file console_logger.h.

std::string ConsoleLogger::BRIGHT_CYAN = "96m" [static, private]

The bright color cyan.

Definition at line 87 of file console_logger.h.

std::string ConsoleLogger::BRIGHT_GREEN = "92m" [static, private]

The bright color green.

Definition at line 79 of file console_logger.h.

std::string ConsoleLogger::BRIGHT_PURPLE = "95m" [static, private]

The bright color purple.

Definition at line 85 of file console_logger.h.

std::string ConsoleLogger::BRIGHT_RED = "91m" [static, private]

The bright color red.

Definition at line 77 of file console_logger.h.

std::string ConsoleLogger::BRIGHT_YELLOW = "93m" [static, private]

The bright color yellow.

Definition at line 81 of file console_logger.h.

std::string ConsoleLogger::CYAN = "36m" [static, private]

The color cyan.

Definition at line 74 of file console_logger.h.

std::string ConsoleLogger::DEFAULT = "0m" [static, private]

The default color.

Definition at line 62 of file console_logger.h.

std::string ConsoleLogger::end_color = "\033[0m" [static, private]

The end tag for colors (default color).

Definition at line 59 of file console_logger.h.

std::string ConsoleLogger::GREEN = "32m" [static, private]

The color green.

Definition at line 66 of file console_logger.h.

std::string ConsoleLogger::prefix_ [private]

The prefix for this ConsoleLogger.

Definition at line 54 of file console_logger.h.

std::string ConsoleLogger::PURPLE = "35m" [static, private]

The color purple.

Definition at line 72 of file console_logger.h.

std::string ConsoleLogger::RED = "31m" [static, private]

The color red.

Definition at line 64 of file console_logger.h.

std::string ConsoleLogger::start_color = "\033[" [static, private]

The start tag for colors.

Definition at line 57 of file console_logger.h.

The verbosity.

Definition at line 90 of file console_logger.h.

std::string ConsoleLogger::YELLOW = "33m" [static, private]

The color yellow.

Definition at line 68 of file console_logger.h.


The documentation for this class was generated from the following files:

engagement_recognition
Author(s): Brett Ponsler (bponsler (at) wpi (dot) edu)
autogenerated on Fri Sep 9 10:35:49 2011