#include <CeylanLogHolder.h>
Public Types | |
enum | TextOutputFormat { rawText, html } |
Defines what text output formats for TextDisplayable instances are available. More... | |
Public Member Functions | |
LogHolder (Ceylan::Uint16 argCount, const char *const arguments[], bool immediateWrite=true) | |
Creates a LogHolder. | |
virtual | ~LogHolder () throw () |
Basic virtual destructor. | |
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 | IsAKnownPlugOption (const std::string &option) |
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 | ConsolePlugOption = "--consolePlug" |
Command-line option which is to be used to select the console plug. | |
static const std::string | ClassicalPlugOption = "--classicalPlug" |
Command-line option which is to be used to select the classical plug, which is the default plug. | |
static const std::string | HTMLPlugOption = "--HTMLPlug" |
Command-line option which is to be used to select the HTML plug. | |
static const std::string | NullPlugOption = "--nullPlug" |
Command-line option which is to be used to select the null plug. | |
static KnownPlugs | DefaultPlug = classicalPlug |
The default plug, chosen if no specific plug is requested thanks to command-line parameters. | |
Protected Attributes | |
KnownPlugs | _chosenPlug |
Records the chosen plug, in order to be able to stop it. | |
Static Protected Attributes | |
static TextOutputFormat | _OutputFormat = rawText |
The text format to be used currently by TextDisplayable instances. | |
Private Member Functions | |
LogHolder (const LogHolder &source) | |
Copy constructor made private to ensure that it will be never called. | |
LogHolder & | operator= (const LogHolder &source) |
Assignment operator made private to ensure that it will be never called. |
Definition at line 130 of file CeylanLogHolder.h.
enum Ceylan::TextDisplayable::TextOutputFormat [inherited] |
Defines what text output formats for TextDisplayable instances are available.
Definition at line 124 of file CeylanTextDisplayable.h.
LogHolder::LogHolder | ( | Ceylan::Uint16 | argCount, | |
const char *const | arguments[], | |||
bool | immediateWrite = true | |||
) |
Creates a LogHolder.
Reads the command-line arguments, and uses them to choose a specific LogPlug, if specified, otherwise uses default log plug.
Command-line parameters are left untouched (read-only).
Only the first log plug specification found in command-line is taken into account.
argCount | the number of arguments (argc). | |
arguments | the arguments themselves (argv). | |
immediateWrite | if true, selects immediate write for the selected plug, if supported (this is the case of the console and the classical plug, but not for the HTML one); otherwise (if false), deferred writes will be performed (if the plug supports it). |
LogException | if the log system could not be correctly started. |
Definition at line 74 of file CeylanLogHolder.cc.
References _chosenPlug, CEYLAN_LOG, Ceylan::Log::classicalPlug, ClassicalPlugOption, Ceylan::Log::consolePlug, ConsolePlugOption, dataUtils::e, Ceylan::emergencyShutdown(), Ceylan::Log::LogPlug::GetSpeakerNameFrom(), Ceylan::TextDisplayable::html, Ceylan::Log::HTMLPlug, HTMLPlugOption, Ceylan::Log::nullPlug, NullPlugOption, Ceylan::TextDisplayable::rawText, Ceylan::Log::LogPlug::SetFullExecutablePath(), Ceylan::TextDisplayable::SetOutputFormat(), Ceylan::Log::LogPlugNull::StartService(), Ceylan::Log::LogPlugHTML::StartService(), Ceylan::Log::LogPlugClassical::StartService(), Ceylan::Log::LogPlugConsole::StartService(), and Ceylan::Exception::toString().
LogHolder::~LogHolder | ( | ) | throw () [virtual] |
Basic virtual destructor.
Definition at line 174 of file CeylanLogHolder.cc.
References _chosenPlug, CEYLAN_LOG, Ceylan::Log::classicalPlug, Ceylan::Log::consolePlug, Ceylan::ExitFailure, Ceylan::Log::HTMLPlug, Ceylan::Log::nullPlug, Ceylan::Log::LogPlugNull::StopService(), Ceylan::Log::LogPlugHTML::StopService(), Ceylan::Log::LogPlugClassical::StopService(), and Ceylan::Log::LogPlugConsole::StopService().
Ceylan::Log::LogHolder::LogHolder | ( | const LogHolder & | source | ) | [private] |
Copy constructor made private to ensure that it will be never called.
The compiler should complain whenever this undefined constructor is called, implicitly or not.
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().
bool LogHolder::IsAKnownPlugOption | ( | const std::string & | option | ) | [static] |
Definition at line 244 of file CeylanLogHolder.cc.
References ClassicalPlugOption, ConsolePlugOption, generalUtils::false, HTMLPlugOption, NullPlugOption, and generalUtils::true.
Assignment operator made private to ensure that it will be never called.
The compiler should complain whenever this undefined operator is called, implicitly or not.
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 LogHolder().
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 LogHolder::toString | ( | Ceylan::VerbosityLevels | level = Ceylan::high |
) | const [virtual] |
Returns a user-friendly description of the state of this object.
Implements Ceylan::TextDisplayable.
Definition at line 212 of file CeylanLogHolder.cc.
References _chosenPlug, Ceylan::Log::classicalPlug, Ceylan::Log::consolePlug, Ceylan::Log::HTMLPlug, and Ceylan::Log::nullPlug.
KnownPlugs Ceylan::Log::LogHolder::_chosenPlug [protected] |
Records the chosen plug, in order to be able to stop it.
Definition at line 244 of file CeylanLogHolder.h.
Referenced by LogHolder(), toString(), and ~LogHolder().
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().
const string LogHolder::ClassicalPlugOption = "--classicalPlug" [static] |
Command-line option which is to be used to select the classical plug, which is the default plug.
Definition at line 215 of file CeylanLogHolder.h.
Referenced by IsAKnownPlugOption(), and LogHolder().
const string LogHolder::ConsolePlugOption = "--consolePlug" [static] |
Command-line option which is to be used to select the console plug.
Definition at line 207 of file CeylanLogHolder.h.
Referenced by IsAKnownPlugOption(), and LogHolder().
KnownPlugs LogHolder::DefaultPlug = classicalPlug [static] |
The default plug, chosen if no specific plug is requested thanks to command-line parameters.
Definition at line 237 of file CeylanLogHolder.h.
const string LogHolder::HTMLPlugOption = "--HTMLPlug" [static] |
Command-line option which is to be used to select the HTML plug.
Definition at line 222 of file CeylanLogHolder.h.
Referenced by IsAKnownPlugOption(), and LogHolder().
const string LogHolder::NullPlugOption = "--nullPlug" [static] |
Command-line option which is to be used to select the null plug.
Definition at line 229 of file CeylanLogHolder.h.
Referenced by IsAKnownPlugOption(), and LogHolder().