#include <CeylanLoggable.h>
Public Types | |
enum | TextOutputFormat { rawText, html } |
Defines what text output formats for TextDisplayable instances are available. More... | |
Public Member Functions | |
Loggable (const std::string &name) | |
Constructs a Loggable object whose Log identifier is name. | |
virtual | ~Loggable () throw () |
Basic virtual destructor, closes the underlying log channel. | |
void | setChannelName (const std::string &channelName) |
Sets this Logable channel name. | |
bool | hasChannelName () const |
Returns whether this Log source has a registered channel name. | |
std::string | getChannelName () const |
Returns this LogSource channel name. | |
void | setLevelOfDetail (LevelOfDetail newLevel) |
Sets this LogSource level of detail of interest. | |
LevelOfDetail | getLevelOfDetail () const |
Returns this LogSource channel name. | |
virtual void | send (const std::string &message, LevelOfDetail levelOfDetail=DefaultLevelOfDetailForMessage) |
Sends message to this LogSource's internal channel, through known LogTransport. | |
virtual void | sendToChannel (const std::string &channel, const std::string &message, LevelOfDetail levelOfDetail=DefaultLevelOfDetailForMessage) const |
Sends message to the specified channel, through known LogTransport. | |
virtual void | setTransport (LogTransport &newTransport) |
Sets a new Log transport for this LogSource. | |
virtual LogTransport * | getTransport () const |
Returns this LogSource's Log transport. | |
virtual bool | hasTransport () const |
Tells whether this LogSource has a registered Log transport. | |
virtual const std::string | toString (Ceylan::VerbosityLevels level=Ceylan::high) const |
Returns a user-friendly description of the state of this object. | |
Static Public Member Functions | |
static bool | IsALoggableChannelName (const std::string &channelName) |
Returns whether the specified channel name is an object channel name, based on the possible presence of the protocol prefix and separators (typically, loggable://). | |
static const std::string | GetEmbeddedChannelName (const std::string &fullChannelName) |
Returns the real channel name used by a Loggable by removing the protocol prefix and separators (typically, 'loggable://'). | |
static const std::string | ToString (std::list< TextDisplayable * > displayables, Ceylan::VerbosityLevels level=Ceylan::high) |
Returns a user-friendly description of this list of pointers to text displayable instances. | |
static TextOutputFormat | GetOutputFormat () |
Returns the current overall text format to be used by TextDisplayable instances. | |
static void | SetOutputFormat (TextOutputFormat newOutputFormat) |
Sets the current overall text format to be used by TextDisplayable instances. | |
Static Public Attributes | |
static const std::string | ProtocolName = "loggable" |
static const LevelOfDetail | DefaultLevelOfDetailForSource = 10 |
The default level of detail of a Log source. | |
Protected Member Functions | |
virtual void | directSend (const std::string &channel, const std::string &message, LevelOfDetail levelOfDetail=DefaultLevelOfDetailForMessage) const |
Internal method to send messages. | |
virtual void | unlinkTransport () |
Suppresses the link between this LogSource and its Log transport. | |
Protected Attributes | |
std::string | _channelName |
Stores this LogSource channel name. | |
LevelOfDetail | _level |
The current level of detail of interest for this Log source. | |
LogTransport * | _transport |
The LogTransport to be used for sending messages. | |
Static Protected Attributes | |
static TextOutputFormat | _OutputFormat = rawText |
The text format to be used currently by TextDisplayable instances. | |
Private Member Functions | |
Loggable (const Loggable &source) | |
Copy constructor made private to ensure that it will never be called. | |
Loggable & | operator= (const Loggable &source) |
Assignment operator made private to ensure that it will never be called. |
A Loggable objet is a LogSource dedicated to an object.
Definition at line 56 of file CeylanLoggable.h.
enum Ceylan::TextDisplayable::TextOutputFormat [inherited] |
Defines what text output formats for TextDisplayable instances are available.
Definition at line 124 of file CeylanTextDisplayable.h.
Loggable::Loggable | ( | const std::string & | name | ) | [explicit] |
Constructs a Loggable object whose Log identifier is name.
name | the name of the Loggable which will be used for its private channel. | |
trackInstance | tells whether the created instances's lifecycle is to be watched through the log system (ex: deallocation notice). |
Definition at line 46 of file CeylanLoggable.cc.
References setChannelName().
Loggable::~Loggable | ( | ) | throw () [virtual] |
Basic virtual destructor, closes the underlying log channel.
Definition at line 56 of file CeylanLoggable.cc.
Ceylan::Log::Loggable::Loggable | ( | const Loggable & | source | ) | [private] |
Copy constructor made private to ensure that it will never be called.
The compiler should complain whenever this undefined constructor is called, implicitly or not.
void LogSource::directSend | ( | const std::string & | channel, | |
const std::string & | message, | |||
LevelOfDetail | levelOfDetail = DefaultLevelOfDetailForMessage | |||
) | const [protected, virtual, inherited] |
Internal method to send messages.
Filters them out if their level of detail is higher than the one of this log source.
Definition at line 164 of file CeylanLogSource.cc.
References Ceylan::Log::LogSource::_transport, and Ceylan::Log::LogTransport::propagate().
Referenced by Ceylan::Log::LogSource::send(), and Ceylan::Log::LogSource::sendToChannel().
std::string LogSource::getChannelName | ( | ) | const [inherited] |
Returns this LogSource channel name.
Definition at line 101 of file CeylanLogSource.cc.
References Ceylan::Log::LogSource::_channelName.
Referenced by Ceylan::Log::LogSource::toString().
const string Loggable::GetEmbeddedChannelName | ( | const std::string & | fullChannelName | ) | [static] |
Returns the real channel name used by a Loggable by removing the protocol prefix and separators (typically, 'loggable://').
Definition at line 83 of file CeylanLoggable.cc.
References Ceylan::URI::getEmbeddedURI(), and Ceylan::URI::ProtocolSeparator.
Referenced by Ceylan::Log::ObjectChannel::addMessage(), Ceylan::Log::LogAggregator::createLoggableChannelFrom(), Ceylan::Log::LogAggregator::createObjectChannel(), Ceylan::Log::LogAggregator::findChannel(), and Ceylan::Log::LogAggregator::storeObjectMessage().
LevelOfDetail LogSource::getLevelOfDetail | ( | ) | const [inherited] |
Returns this LogSource channel name.
Definition at line 119 of file CeylanLogSource.cc.
References Ceylan::Log::LogSource::_level.
TextDisplayable::TextOutputFormat TextDisplayable::GetOutputFormat | ( | ) | [static, inherited] |
Returns the current overall text format to be used by TextDisplayable instances.
Definition at line 63 of file CeylanTextDisplayable.cc.
References Ceylan::TextDisplayable::_OutputFormat.
Referenced by Ceylan::formatStringList(), Ceylan::formatStringMap(), Ceylan::XML::XMLMarkup::toString(), Ceylan::Maths::Linear::Vector3::toString(), Ceylan::Maths::Linear::Vector2::toString(), Ceylan::Maths::Linear::Tripoint::toString(), Ceylan::Module::toString(), Ceylan::Maths::Linear::Matrix3::toString(), Ceylan::Maths::Linear::Matrix2::toString(), Ceylan::Maths::Linear::HomogeneousMatrix3::toString(), and Ceylan::Maths::Linear::Bipoint::toString().
LogTransport * LogSource::getTransport | ( | ) | const [virtual, inherited] |
Returns this LogSource's Log transport.
Definition at line 209 of file CeylanLogSource.cc.
References Ceylan::Log::LogSource::_transport.
bool LogSource::hasChannelName | ( | ) | const [inherited] |
Returns whether this Log source has a registered channel name.
Definition at line 83 of file CeylanLogSource.cc.
References Ceylan::Log::LogSource::_channelName.
Referenced by Ceylan::Log::LogSource::toString().
bool LogSource::hasTransport | ( | ) | const [virtual, inherited] |
Tells whether this LogSource has a registered Log transport.
Definition at line 218 of file CeylanLogSource.cc.
References Ceylan::Log::LogSource::_transport.
Referenced by Ceylan::Log::LogSource::setTransport().
bool Loggable::IsALoggableChannelName | ( | const std::string & | channelName | ) | [static] |
Returns whether the specified channel name is an object channel name, based on the possible presence of the protocol prefix and separators (typically, loggable://).
Definition at line 73 of file CeylanLoggable.cc.
References Ceylan::URI::getProtocolName(), ProtocolName, and Ceylan::URI::ProtocolSeparator.
Referenced by Ceylan::Log::LogAggregator::findChannel(), and Ceylan::Log::LogAggregator::store().
Assignment operator made private to ensure that it will never be called.
The compiler should complain whenever this undefined operator is called, implicitly or not.
void LogSource::send | ( | const std::string & | message, | |
LevelOfDetail | levelOfDetail = DefaultLevelOfDetailForMessage | |||
) | [virtual, inherited] |
Sends message to this LogSource's internal channel, through known LogTransport.
message | the log message to send. Please avoid characters '<' and '>' since they have a special meaning for HTML log output. These characters used to be filtered in HTML aggregators but it prevented messages to contain HTML tags on purpose, which proved to be convenient. | |
levelOfDetail | the level of detail of this message (level 1 by default). |
Reimplemented in Ceylan::Object, and Ceylan::Log::MuteLogSource.
Definition at line 128 of file CeylanLogSource.cc.
References Ceylan::Log::LogSource::_channelName, and Ceylan::Log::LogSource::directSend().
Referenced by Ceylan::Log::LogPlug::CreateBasicPlug(), Ceylan::Log::LogPlug::debug(), Ceylan::Log::LogPlug::error(), Ceylan::Log::LogPlug::fatal(), Ceylan::Log::LogPlug::info(), Ceylan::Log::LogPlug::logroot(), Ceylan::Log::LogPlug::trace(), and Ceylan::Log::LogPlug::warning().
void LogSource::sendToChannel | ( | const std::string & | channel, | |
const std::string & | message, | |||
LevelOfDetail | levelOfDetail = DefaultLevelOfDetailForMessage | |||
) | const [virtual, inherited] |
Sends message to the specified channel, through known LogTransport.
channel | the channel name which will identify the targeted Loglistener. | |
message | the log message to send. Please avoid characters '<' and '>' since they have a special meaning for HTML log output. These characters used to be filtered in HTML aggregators but it prevented messages to contain HTML tags on purpose, which proved to be convenient. | |
levelOfDetail | the level of detail of this message (level 1 by default). |
Definition at line 142 of file CeylanLogSource.cc.
References Ceylan::Log::LogSource::_level, CEYLAN_LOG, Ceylan::Log::LogSource::directSend(), and Ceylan::toString().
void Loggable::setChannelName | ( | const std::string & | channelName | ) |
Sets this Logable channel name.
Reimplemented from Ceylan::Log::LogSource.
Definition at line 63 of file CeylanLoggable.cc.
References ProtocolName, and Ceylan::URI::ProtocolSeparator.
Referenced by Loggable().
void LogSource::setLevelOfDetail | ( | LevelOfDetail | newLevel | ) | [inherited] |
Sets this LogSource level of detail of interest.
Definition at line 110 of file CeylanLogSource.cc.
References Ceylan::Log::LogSource::_level.
void TextDisplayable::SetOutputFormat | ( | TextOutputFormat | newOutputFormat | ) | [static, inherited] |
Sets the current overall text format to be used by TextDisplayable instances.
newOutputFormat | the new output format. |
Definition at line 72 of file CeylanTextDisplayable.cc.
References Ceylan::TextDisplayable::_OutputFormat.
Referenced by Ceylan::Log::LogHolder::LogHolder().
void LogSource::setTransport | ( | LogTransport & | newTransport | ) | [virtual, inherited] |
Sets a new Log transport for this LogSource.
Definition at line 191 of file CeylanLogSource.cc.
References Ceylan::Log::LogSource::_transport, Ceylan::Log::LogSource::hasTransport(), Ceylan::Log::LogSource::unlinkTransport(), and Ceylan::Log::LogPlug::warning().
const std::string TextDisplayable::ToString | ( | std::list< TextDisplayable * > | displayables, | |
Ceylan::VerbosityLevels | level = Ceylan::high | |||
) | [static, inherited] |
Returns a user-friendly description of this list of pointers to text displayable instances.
displayables | a list of pointers to TextDisplayable instances/ | |
level | the requested verbosity level. |
Definition at line 45 of file CeylanTextDisplayable.cc.
References Ceylan::formatStringList().
const string LogSource::toString | ( | Ceylan::VerbosityLevels | level = Ceylan::high |
) | const [virtual, inherited] |
Returns a user-friendly description of the state of this object.
level | the requested verbosity level. |
Implements Ceylan::TextDisplayable.
Reimplemented in Ceylan::Object, Ceylan::Log::MuteLogSource, Ceylan::Maths::Random::RandomGenerator, Ceylan::Maths::Random::RandomGeneratorFromPDF, Ceylan::Maths::Random::WhiteNoiseGenerator, Ceylan::Module, and Ceylan::Plugin.
Definition at line 227 of file CeylanLogSource.cc.
References Ceylan::Log::LogSource::_level, Ceylan::Log::LogSource::getChannelName(), Ceylan::Log::LogSource::hasChannelName(), and Ceylan::toNumericalString().
Referenced by Ceylan::Log::LogPlug::ToString().
void LogSource::unlinkTransport | ( | ) | [protected, virtual, inherited] |
Suppresses the link between this LogSource and its Log transport.
Definition at line 243 of file CeylanLogSource.cc.
Referenced by Ceylan::Log::LogSource::setTransport(), and Ceylan::Log::LogSource::~LogSource().
std::string Ceylan::Log::LogSource::_channelName [protected, inherited] |
Stores this LogSource channel name.
Definition at line 242 of file CeylanLogSource.h.
Referenced by Ceylan::Log::LogSource::getChannelName(), Ceylan::Log::LogSource::hasChannelName(), Ceylan::Log::LogSource::send(), and Ceylan::Log::LogSource::setChannelName().
LevelOfDetail Ceylan::Log::LogSource::_level [protected, inherited] |
The current level of detail of interest for this Log source.
Definition at line 246 of file CeylanLogSource.h.
Referenced by Ceylan::Log::LogSource::getLevelOfDetail(), Ceylan::Log::LogSource::sendToChannel(), Ceylan::Log::LogSource::setLevelOfDetail(), and Ceylan::Log::LogSource::toString().
TextDisplayable::TextOutputFormat TextDisplayable::_OutputFormat = rawText [static, protected, inherited] |
The text format to be used currently by TextDisplayable instances.
Definition at line 158 of file CeylanTextDisplayable.h.
Referenced by Ceylan::TextDisplayable::GetOutputFormat(), and Ceylan::TextDisplayable::SetOutputFormat().
LogTransport* Ceylan::Log::LogSource::_transport [protected, inherited] |
The LogTransport to be used for sending messages.
Definition at line 258 of file CeylanLogSource.h.
Referenced by Ceylan::Log::LogSource::directSend(), Ceylan::Log::LogSource::getTransport(), Ceylan::Log::LogSource::hasTransport(), and Ceylan::Log::LogSource::setTransport().
const LevelOfDetail Ceylan::Log::LogSource::DefaultLevelOfDetailForSource = 10 [static, inherited] |
const string Loggable::ProtocolName = "loggable" [static] |
Definition at line 122 of file CeylanLoggable.h.
Referenced by IsALoggableChannelName(), and setChannelName().