ldas-tools-al  2.6.4
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
LDASTools::AL::Log Class Reference

Logging class. More...

#include <Log.hh>

Inheritance diagram for LDASTools::AL::Log:
Inheritance graph
[legend]
Collaboration diagram for LDASTools::AL::Log:
Collaboration graph
[legend]

Classes

struct  message_queue_entry_type
 Information about a log message. More...
 
class  StreamCBInterface
 Class to handle stream callbacks. More...
 
class  StreamFile
 
class  StreamInterface
 Class to handle streaming of messages. More...
 
class  StreamStdErr
 

Public Types

typedef int group_type
 Type for group. More...
 
typedef boost::shared_ptr< StreamInterfacestream_type
 
typedef boost::shared_ptr< StreamFilestream_file_type
 
typedef int level_type
 Type for level. More...
 
typedef int group_type
 Type for group. More...
 
typedef boost::shared_ptr< StreamInterfacestream_type
 
typedef boost::shared_ptr< StreamFilestream_file_type
 
typedef int level_type
 Type for level. More...
 
typedef int group_type
 Type for group. More...
 
typedef boost::shared_ptr< StreamInterfacestream_type
 
typedef boost::shared_ptr< StreamFilestream_file_type
 
typedef int level_type
 Type for level. More...
 
enum  cancel_type {
  CANCEL_ABANDON, CANCEL_IGNORE, CANCEL_ASYNCHRONOUS, CANCEL_DEFERRED,
  CANCEL_EXCEPTION, CANCEL_BY_SIGNAL, CANCEL_UNKNOWN, CANCEL_ABANDON,
  CANCEL_IGNORE, CANCEL_ASYNCHRONOUS, CANCEL_DEFERRED, CANCEL_EXCEPTION,
  CANCEL_BY_SIGNAL, CANCEL_UNKNOWN, CANCEL_ABANDON, CANCEL_IGNORE,
  CANCEL_ASYNCHRONOUS, CANCEL_DEFERRED, CANCEL_EXCEPTION, CANCEL_BY_SIGNAL,
  CANCEL_UNKNOWN
}
 
enum  cancel_type {
  CANCEL_ABANDON, CANCEL_IGNORE, CANCEL_ASYNCHRONOUS, CANCEL_DEFERRED,
  CANCEL_EXCEPTION, CANCEL_BY_SIGNAL, CANCEL_UNKNOWN, CANCEL_ABANDON,
  CANCEL_IGNORE, CANCEL_ASYNCHRONOUS, CANCEL_DEFERRED, CANCEL_EXCEPTION,
  CANCEL_BY_SIGNAL, CANCEL_UNKNOWN, CANCEL_ABANDON, CANCEL_IGNORE,
  CANCEL_ASYNCHRONOUS, CANCEL_DEFERRED, CANCEL_EXCEPTION, CANCEL_BY_SIGNAL,
  CANCEL_UNKNOWN
}
 
enum  cancel_type {
  CANCEL_ABANDON, CANCEL_IGNORE, CANCEL_ASYNCHRONOUS, CANCEL_DEFERRED,
  CANCEL_EXCEPTION, CANCEL_BY_SIGNAL, CANCEL_UNKNOWN, CANCEL_ABANDON,
  CANCEL_IGNORE, CANCEL_ASYNCHRONOUS, CANCEL_DEFERRED, CANCEL_EXCEPTION,
  CANCEL_BY_SIGNAL, CANCEL_UNKNOWN, CANCEL_ABANDON, CANCEL_IGNORE,
  CANCEL_ASYNCHRONOUS, CANCEL_DEFERRED, CANCEL_EXCEPTION, CANCEL_BY_SIGNAL,
  CANCEL_UNKNOWN
}
 
typedef SignalHandler::signal_type signal_type
 
typedef SignalHandler::signal_type signal_type
 
typedef SignalHandler::signal_type signal_type
 
typedef void(* cleanup_function_type) (void *)
 
typedef void(* cleanup_function_type) (void *)
 
typedef void(* cleanup_function_type) (void *)
 

Public Member Functions

 Log (const std::string &BaseName)
 Constructor. More...
 
 ~Log ()
 Destructor. More...
 
void Message (const group_type Group, const level_type Level, const std::string &Message)
 Send a message to the log. More...
 
void Stream (stream_type Output)
 Set the stream to use for output. More...
 
stream_type Stream ()
 
void Sync () const
 
void Verbosity (const group_type Group, const level_type Level)
 Establish logging level for a given group. More...
 
bool VerbosityCheck (const group_type Group, const level_type Level) const
 Check if the message will be logged. More...
 
void EntriesMax (int Value)
 Specify the maximum number of entries per file. More...
 
 Log (const std::string &BaseName)
 Constructor. More...
 
 ~Log ()
 Destructor. More...
 
void Message (const group_type Group, const level_type Level, const std::string &Message)
 Send a message to the log. More...
 
void Stream (stream_type Output)
 Set the stream to use for output. More...
 
stream_type Stream ()
 
void Sync () const
 
void Verbosity (const group_type Group, const level_type Level)
 Establish logging level for a given group. More...
 
bool VerbosityCheck (const group_type Group, const level_type Level) const
 Check if the message will be logged. More...
 
void EntriesMax (int Value)
 Specify the maximum number of entries per file. More...
 
 Log (const std::string &BaseName)
 Constructor. More...
 
 ~Log ()
 Destructor. More...
 
void Message (const group_type Group, const level_type Level, const std::string &Message)
 Send a message to the log. More...
 
void Stream (stream_type Output)
 Set the stream to use for output. More...
 
stream_type Stream ()
 
void Sync () const
 
void Verbosity (const group_type Group, const level_type Level)
 Establish logging level for a given group. More...
 
bool VerbosityCheck (const group_type Group, const level_type Level) const
 Check if the message will be logged. More...
 
void EntriesMax (int Value)
 Specify the maximum number of entries per file. More...
 
virtual void Cancel ()
 
virtual void Cancel ()
 
virtual void Cancel ()
 
void CancellationCheck (const std::string &Header, const char *File, const int Line) const
 Deliver pending cancellation requests to the calling thread. More...
 
void CancellationCheck (const std::string &Header, const char *File, const int Line) const
 Deliver pending cancellation requests to the calling thread. More...
 
void CancellationCheck (const std::string &Header, const char *File, const int Line) const
 Deliver pending cancellation requests to the calling thread. More...
 
void CancellationEnable (bool Value)
 
void CancellationEnable (bool Value)
 
void CancellationEnable (bool Value)
 
cancel_type CancellationType (signal_type &Signal) const
 Return the type of cancellation. More...
 
void CancellationType (cancel_type Type, signal_type Signal=SignalHandler::SIGNAL_UNKNOWN)
 Establiosh the type of cancellation. More...
 
cancel_type CancellationType (signal_type &Signal) const
 Return the type of cancellation. More...
 
void CancellationType (cancel_type Type, signal_type Signal=SignalHandler::SIGNAL_UNKNOWN)
 Establiosh the type of cancellation. More...
 
cancel_type CancellationType (signal_type &Signal) const
 Return the type of cancellation. More...
 
void CancellationType (cancel_type Type, signal_type Signal=SignalHandler::SIGNAL_UNKNOWN)
 Establiosh the type of cancellation. More...
 
void Detach () const
 
void Detach () const
 
void Detach () const
 
virtual void Join ()
 
virtual void Join ()
 
virtual void Join ()
 
bool IsAlive () const
 
bool IsAlive () const
 
bool IsAlive () const
 
bool IsCancelled () const
 Return the cancellation state of the thread. More...
 
bool IsCancelled () const
 Return the cancellation state of the thread. More...
 
bool IsCancelled () const
 Return the cancellation state of the thread. More...
 
bool IsDetached () const
 Reports detached state. More...
 
bool IsDetached () const
 Reports detached state. More...
 
bool IsDetached () const
 Reports detached state. More...
 
bool IsParentThread () const
 
bool IsParentThread () const
 
bool IsParentThread () const
 
int Kill (signal_type Signal) const
 
int Kill (signal_type Signal) const
 
int Kill (signal_type Signal) const
 
thread_type ParentThread () const
 Retrieve key for parent thread. More...
 
thread_type ParentThread () const
 Retrieve key for parent thread. More...
 
thread_type ParentThread () const
 Retrieve key for parent thread. More...
 
virtual int Spawn ()
 
virtual int Spawn ()
 
virtual int Spawn ()
 
void SignalCapture (signal_type Sig)
 
void SignalCapture (signal_type Sig)
 
void SignalCapture (signal_type Sig)
 
void SignalIgnore (signal_type Sig)
 
void SignalIgnore (signal_type Sig)
 
void SignalIgnore (signal_type Sig)
 
bool operator== (const Thread &Source) const
 
bool operator== (const Thread &Source) const
 
bool operator== (const Thread &Source) const
 

Static Public Member Functions

static void SelfCancellationCheck (const std::string &Header, const char *File, const int Line)
 
static void SelfCancellationCheck (const std::string &Header, const char *File, const int Line)
 
static void SelfCancellationCheck (const std::string &Header, const char *File, const int Line)
 
static size_t StackSizeDefault ()
 
static void StackSizeDefault (size_t StackSize)
 
static size_t StackSizeDefault ()
 
static void StackSizeDefault (size_t StackSize)
 
static size_t StackSizeDefault ()
 
static void StackSizeDefault (size_t StackSize)
 

Protected Types

typedef void *(* start_function_type) (void *)
 
typedef void *(* start_function_type) (void *)
 
typedef void *(* start_function_type) (void *)
 

Protected Member Functions

virtual void onStreamClose ()
 Hook to do additional action when the stream is closed. More...
 
virtual void onStreamOpen ()
 Hook to do additional action when the stream is opened. More...
 
void purge ()
 Flush the output queue. More...
 
virtual void onStreamClose ()
 Hook to do additional action when the stream is closed. More...
 
virtual void onStreamOpen ()
 Hook to do additional action when the stream is opened. More...
 
void purge ()
 Flush the output queue. More...
 
virtual void onStreamClose ()
 Hook to do additional action when the stream is closed. More...
 
virtual void onStreamOpen ()
 Hook to do additional action when the stream is opened. More...
 
void purge ()
 Flush the output queue. More...
 
int spawn (start_function_type StartFunction=(start_function_type) start_routine)
 Spawn a new thread. More...
 
int spawn (start_function_type StartFunction=(start_function_type) start_routine)
 Spawn a new thread. More...
 
int spawn (start_function_type StartFunction=(start_function_type) start_routine)
 Spawn a new thread. More...
 
thread_type threadId () const
 
thread_type threadId () const
 
thread_type threadId () const
 

Static Protected Member Functions

static void cancelCleanup (Thread *Source)
 Perform cleanup of a cancelled thread. More...
 
static void cancelCleanup (Thread *Source)
 Perform cleanup of a cancelled thread. More...
 
static void cancelCleanup (Thread *Source)
 Perform cleanup of a cancelled thread. More...
 

Protected Attributes

stream_type m_stream
 Active output stream. More...
 
bool stream_delete_on_destruct
 

Private Types

typedef std::queue< message_queue_entry_typemessage_queue_type
 
typedef LDASTools::AL::unordered_map< group_type, level_typeverbose_map_type
 Container type for managing verbosity levels. More...
 
typedef std::queue< message_queue_entry_typemessage_queue_type
 
typedef LDASTools::AL::unordered_map< group_type, level_typeverbose_map_type
 Container type for managing verbosity levels. More...
 
typedef std::queue< message_queue_entry_typemessage_queue_type
 
typedef LDASTools::AL::unordered_map< group_type, level_typeverbose_map_type
 Container type for managing verbosity levels. More...
 

Private Member Functions

virtual void action ()
 Output contents of the message queue to the output stream. More...
 
void flush (bool EveryThing=false)
 Flush all remaining messages to the log file. More...
 
void write_message (const message_queue_entry_type &MessageInfo)
 Write message to the output stream. More...
 
virtual void action ()
 Output contents of the message queue to the output stream. More...
 
void flush (bool EveryThing=false)
 Flush all remaining messages to the log file. More...
 
void write_message (const message_queue_entry_type &MessageInfo)
 Write message to the output stream. More...
 
virtual void action ()
 Output contents of the message queue to the output stream. More...
 
void flush (bool EveryThing=false)
 Flush all remaining messages to the log file. More...
 
void write_message (const message_queue_entry_type &MessageInfo)
 Write message to the output stream. More...
 

Private Attributes

const std::string m_base_name
 
int m_entries_max
 
message_queue_type m_message_queue
 Storage for pending message. More...
 
message_queue_type m_output_queue
 Storage for output message. More...
 
MutexLock::baton_type m_message_baton
 Protect integrity of the message queue. More...
 
verbose_map_type m_verbosity
 Keep track of the verbosity of each group. More...
 

Friends

class LogCB
 

Detailed Description

Logging class.

This is a very simple logging class that is thread safe. It does support seperate debugging levels for each group.

Member Typedef Documentation

◆ cleanup_function_type [1/3]

typedef void( * LDASTools::AL::Thread::cleanup_function_type) (void *)
inherited

◆ cleanup_function_type [2/3]

typedef void( * LDASTools::AL::Thread::cleanup_function_type) (void *)
inherited

◆ cleanup_function_type [3/3]

typedef void( * LDASTools::AL::Thread::cleanup_function_type) (void *)
inherited

◆ group_type [1/3]

Type for group.

This is the data type used when referencing parameters representing the group associated with the message.

◆ group_type [2/3]

Type for group.

This is the data type used when referencing parameters representing the group associated with the message.

◆ group_type [3/3]

Type for group.

This is the data type used when referencing parameters representing the group associated with the message.

◆ level_type [1/3]

Type for level.

This is the data type used when referencing parameters representing the level of message.

◆ level_type [2/3]

Type for level.

This is the data type used when referencing parameters representing the level of message.

◆ level_type [3/3]

Type for level.

This is the data type used when referencing parameters representing the level of message.

◆ message_queue_type [1/3]

The message_queue_type is used to represent the storage class used for the message queue.

◆ message_queue_type [2/3]

The message_queue_type is used to represent the storage class used for the message queue.

◆ message_queue_type [3/3]

The message_queue_type is used to represent the storage class used for the message queue.

◆ signal_type [1/3]

◆ signal_type [2/3]

◆ signal_type [3/3]

◆ start_function_type [1/3]

typedef void*( * LDASTools::AL::Thread::start_function_type) (void *)
protectedinherited

◆ start_function_type [2/3]

typedef void*( * LDASTools::AL::Thread::start_function_type) (void *)
protectedinherited

◆ start_function_type [3/3]

typedef void*( * LDASTools::AL::Thread::start_function_type) (void *)
protectedinherited

◆ stream_file_type [1/3]

typedef boost::shared_ptr< StreamFile > LDASTools::AL::Log::stream_file_type

◆ stream_file_type [2/3]

typedef boost::shared_ptr< StreamFile > LDASTools::AL::Log::stream_file_type

◆ stream_file_type [3/3]

typedef boost::shared_ptr< StreamFile > LDASTools::AL::Log::stream_file_type

◆ stream_type [1/3]

typedef boost::shared_ptr< StreamInterface > LDASTools::AL::Log::stream_type

The stream_type is used to represent the output stream class used to log the messages.

◆ stream_type [2/3]

typedef boost::shared_ptr< StreamInterface > LDASTools::AL::Log::stream_type

The stream_type is used to represent the output stream class used to log the messages.

◆ stream_type [3/3]

typedef boost::shared_ptr< StreamInterface > LDASTools::AL::Log::stream_type

The stream_type is used to represent the output stream class used to log the messages.

◆ verbose_map_type [1/3]

Container type for managing verbosity levels.

◆ verbose_map_type [2/3]

Container type for managing verbosity levels.

◆ verbose_map_type [3/3]

Container type for managing verbosity levels.

Member Enumeration Documentation

◆ cancel_type [1/3]

Enumerator
CANCEL_ABANDON 
CANCEL_IGNORE 
CANCEL_ASYNCHRONOUS 
CANCEL_DEFERRED 
CANCEL_EXCEPTION 
CANCEL_BY_SIGNAL 
CANCEL_UNKNOWN 
CANCEL_ABANDON 
CANCEL_IGNORE 
CANCEL_ASYNCHRONOUS 
CANCEL_DEFERRED 
CANCEL_EXCEPTION 
CANCEL_BY_SIGNAL 
CANCEL_UNKNOWN 
CANCEL_ABANDON 
CANCEL_IGNORE 
CANCEL_ASYNCHRONOUS 
CANCEL_DEFERRED 
CANCEL_EXCEPTION 
CANCEL_BY_SIGNAL 
CANCEL_UNKNOWN 

◆ cancel_type [2/3]

Enumerator
CANCEL_ABANDON 
CANCEL_IGNORE 
CANCEL_ASYNCHRONOUS 
CANCEL_DEFERRED 
CANCEL_EXCEPTION 
CANCEL_BY_SIGNAL 
CANCEL_UNKNOWN 
CANCEL_ABANDON 
CANCEL_IGNORE 
CANCEL_ASYNCHRONOUS 
CANCEL_DEFERRED 
CANCEL_EXCEPTION 
CANCEL_BY_SIGNAL 
CANCEL_UNKNOWN 
CANCEL_ABANDON 
CANCEL_IGNORE 
CANCEL_ASYNCHRONOUS 
CANCEL_DEFERRED 
CANCEL_EXCEPTION 
CANCEL_BY_SIGNAL 
CANCEL_UNKNOWN 

◆ cancel_type [3/3]

Enumerator
CANCEL_ABANDON 
CANCEL_IGNORE 
CANCEL_ASYNCHRONOUS 
CANCEL_DEFERRED 
CANCEL_EXCEPTION 
CANCEL_BY_SIGNAL 
CANCEL_UNKNOWN 
CANCEL_ABANDON 
CANCEL_IGNORE 
CANCEL_ASYNCHRONOUS 
CANCEL_DEFERRED 
CANCEL_EXCEPTION 
CANCEL_BY_SIGNAL 
CANCEL_UNKNOWN 
CANCEL_ABANDON 
CANCEL_IGNORE 
CANCEL_ASYNCHRONOUS 
CANCEL_DEFERRED 
CANCEL_EXCEPTION 
CANCEL_BY_SIGNAL 
CANCEL_UNKNOWN 

Constructor & Destructor Documentation

◆ Log() [1/3]

LDASTools::AL::Log::Log ( const std::string &  BaseName)

Constructor.

Parameters
[in]BaseNameThe base name to be used for creation of the log file.
Returns
An instance of this object.

Constructor for the Log class. This will save the base name to use for the log file and start the writing thread.

This class works by seperating the request to log a message and the actual writing of the message. This seperation allows for multiple threads to log messages asyncronously while minimizing the serialization caused by critical resources being locked.

◆ ~Log() [1/3]

LDASTools::AL::Log::~Log ( )

Destructor.

◆ Log() [2/3]

LDASTools::AL::Log::Log ( const std::string &  BaseName)

Constructor.

Parameters
[in]BaseNameThe base name to be used for creation of the log file.
Returns
An instance of this object.

◆ ~Log() [2/3]

LDASTools::AL::Log::~Log ( )

Destructor.

◆ Log() [3/3]

LDASTools::AL::Log::Log ( const std::string &  BaseName)

Constructor.

Parameters
[in]BaseNameThe base name to be used for creation of the log file.
Returns
An instance of this object.

◆ ~Log() [3/3]

LDASTools::AL::Log::~Log ( )

Destructor.

Member Function Documentation

◆ action() [1/3]

void LDASTools::AL::Log::action ( )
privatevirtual

Output contents of the message queue to the output stream.

This method is used for updating the output stream. It is done by a child thread and is started when the object is created. The thread is terminated when the object is destroyed.

Implements LDASTools::AL::Thread.

◆ action() [2/3]

virtual void LDASTools::AL::Log::action ( )
privatevirtual

Output contents of the message queue to the output stream.

Implements LDASTools::AL::Thread.

◆ action() [3/3]

virtual void LDASTools::AL::Log::action ( )
privatevirtual

Output contents of the message queue to the output stream.

Implements LDASTools::AL::Thread.

◆ Cancel() [1/3]

void LDASTools::AL::Thread::Cancel ( )
virtualinherited

◆ Cancel() [2/3]

virtual void LDASTools::AL::Thread::Cancel ( )
virtualinherited

◆ Cancel() [3/3]

virtual void LDASTools::AL::Thread::Cancel ( )
virtualinherited

◆ cancelCleanup() [1/3]

void LDASTools::AL::Thread::cancelCleanup ( Thread Source)
staticprotectedinherited

Perform cleanup of a cancelled thread.

Parameters
[in]SourceThe thread being cancelled.

◆ cancelCleanup() [2/3]

static void LDASTools::AL::Thread::cancelCleanup ( Thread Source)
staticprotectedinherited

Perform cleanup of a cancelled thread.

Parameters
[in]SourceThe thread being cancelled.

◆ cancelCleanup() [3/3]

static void LDASTools::AL::Thread::cancelCleanup ( Thread Source)
staticprotectedinherited

Perform cleanup of a cancelled thread.

Parameters
[in]SourceThe thread being cancelled.

◆ CancellationCheck() [1/3]

void LDASTools::AL::Thread::CancellationCheck ( const std::string &  Header,
const char *  File,
const int  Line 
) const
inherited

Deliver pending cancellation requests to the calling thread.

Parameters
[in]HeaderDescription of the method from which the request was made
[in]FileFilename from where the request was made.
[in]LineLine number in Filename from where the request was made.

Deliver any pending cancellation requests to the calling thread. If cancellation is to be done via exception, then a cancellation exception is throw. If not, then a call to the appropriate thread library's cancellation routine is made.

Note
This call must only be made by a child thread.

◆ CancellationCheck() [2/3]

void LDASTools::AL::Thread::CancellationCheck ( const std::string &  Header,
const char *  File,
const int  Line 
) const
inherited

Deliver pending cancellation requests to the calling thread.

Parameters
[in]HeaderDescription of the method from which the request was made
[in]FileFilename from where the request was made.
[in]LineLine number in Filename from where the request was made.

◆ CancellationCheck() [3/3]

void LDASTools::AL::Thread::CancellationCheck ( const std::string &  Header,
const char *  File,
const int  Line 
) const
inherited

Deliver pending cancellation requests to the calling thread.

Parameters
[in]HeaderDescription of the method from which the request was made
[in]FileFilename from where the request was made.
[in]LineLine number in Filename from where the request was made.

◆ CancellationEnable() [1/3]

void LDASTools::AL::Thread::CancellationEnable ( bool  Value)
inherited

◆ CancellationEnable() [2/3]

void LDASTools::AL::Thread::CancellationEnable ( bool  Value)
inherited

◆ CancellationEnable() [3/3]

void LDASTools::AL::Thread::CancellationEnable ( bool  Value)
inherited

◆ CancellationType() [1/6]

Thread::cancel_type LDASTools::AL::Thread::CancellationType ( signal_type Signal) const
inherited

Return the type of cancellation.

Parameters
[out]SignalAny auxiliary information associated with the cancellation type
Returns
The type of cancellation.
See also
cancel_type

◆ CancellationType() [2/6]

cancel_type LDASTools::AL::Thread::CancellationType ( signal_type Signal) const
inherited

Return the type of cancellation.

Parameters
[out]SignalAny auxiliary information associated with the cancellation type
Returns
The type of cancellation.
See also
cancel_type

◆ CancellationType() [3/6]

cancel_type LDASTools::AL::Thread::CancellationType ( signal_type Signal) const
inherited

Return the type of cancellation.

Parameters
[out]SignalAny auxiliary information associated with the cancellation type
Returns
The type of cancellation.
See also
cancel_type

◆ CancellationType() [4/6]

void LDASTools::AL::Thread::CancellationType ( cancel_type  Type,
signal_type  Signal = SignalHandler::SIGNAL_UNKNOWN 
)
inherited

Establiosh the type of cancellation.

Parameters
[in]TypeThe type of cancellation.
[in]SignalAny auxiliary information associated with the cancellation type.

Sets a how a thread can be cancelled.

  • CANCEL_ASYNCHRONOUS A cancellation request is immediated delivered to the thread.
  • CANCEL_DEFERRED A cancellation request is marked pending for the thread and the thread is cancelled when it gets to a system cancellation point or when CancellationCheck is called.
  • CANCEL_EXCEPTION A cancellation request is marked pending for the thread and the thread throws a cancellation exception upon calling CancellationCheck.
Note
This call must only be made by a chivld thread.
See also
CancellationEnable, CancellationCheck

◆ CancellationType() [5/6]

void LDASTools::AL::Thread::CancellationType ( cancel_type  Type,
signal_type  Signal = SignalHandler::SIGNAL_UNKNOWN 
)
inherited

Establiosh the type of cancellation.

Parameters
[in]TypeThe type of cancellation.
[in]SignalAny auxiliary information associated with the cancellation type.

◆ CancellationType() [6/6]

void LDASTools::AL::Thread::CancellationType ( cancel_type  Type,
signal_type  Signal = SignalHandler::SIGNAL_UNKNOWN 
)
inherited

Establiosh the type of cancellation.

Parameters
[in]TypeThe type of cancellation.
[in]SignalAny auxiliary information associated with the cancellation type.

◆ Detach() [1/3]

void LDASTools::AL::Thread::Detach ( ) const
inherited

◆ Detach() [2/3]

void LDASTools::AL::Thread::Detach ( ) const
inherited

◆ Detach() [3/3]

void LDASTools::AL::Thread::Detach ( ) const
inherited

◆ EntriesMax() [1/3]

void LDASTools::AL::Log::EntriesMax ( int  Value)
inline

Specify the maximum number of entries per file.

Parameters
[in]ValueThe number of entries.

The Value specified is the maximum number of lines that a file should have before triggering a log rotation request.

◆ EntriesMax() [2/3]

void LDASTools::AL::Log::EntriesMax ( int  Value)

Specify the maximum number of entries per file.

Parameters
[in]ValueThe number of entries.

◆ EntriesMax() [3/3]

void LDASTools::AL::Log::EntriesMax ( int  Value)

Specify the maximum number of entries per file.

Parameters
[in]ValueThe number of entries.

◆ flush() [1/3]

void LDASTools::AL::Log::flush ( bool  EveryThing = false)
private

Flush all remaining messages to the log file.

◆ flush() [2/3]

void LDASTools::AL::Log::flush ( bool  EveryThing = false)
inlineprivate

Flush all remaining messages to the log file.

◆ flush() [3/3]

void LDASTools::AL::Log::flush ( bool  EveryThing = false)
private

Flush all remaining messages to the log file.

◆ IsAlive() [1/3]

bool LDASTools::AL::Thread::IsAlive ( ) const
inherited

◆ IsAlive() [2/3]

bool LDASTools::AL::Thread::IsAlive ( ) const
inherited

◆ IsAlive() [3/3]

bool LDASTools::AL::Thread::IsAlive ( ) const
inherited

◆ IsCancelled() [1/3]

bool LDASTools::AL::Thread::IsCancelled ( ) const
inherited

Return the cancellation state of the thread.

Returns
Returns true if the thread has been cancelled, false otherwise.

◆ IsCancelled() [2/3]

bool LDASTools::AL::Thread::IsCancelled ( ) const
inherited

Return the cancellation state of the thread.

Returns
Returns true if the thread has been cancelled, false otherwise.

◆ IsCancelled() [3/3]

bool LDASTools::AL::Thread::IsCancelled ( ) const
inherited

Return the cancellation state of the thread.

Returns
Returns true if the thread has been cancelled, false otherwise.

◆ IsDetached() [1/3]

bool LDASTools::AL::Thread::IsDetached ( ) const
inherited

Reports detached state.

Returns
Returns true if the thread has been detached, false otherwise

◆ IsDetached() [2/3]

bool LDASTools::AL::Thread::IsDetached ( ) const
inherited

Reports detached state.

Returns
Returns true if the thread has been detached, false otherwise

◆ IsDetached() [3/3]

bool LDASTools::AL::Thread::IsDetached ( ) const
inherited

Reports detached state.

Returns
Returns true if the thread has been detached, false otherwise

◆ IsParentThread() [1/3]

bool LDASTools::AL::Thread::IsParentThread ( ) const
inherited

◆ IsParentThread() [2/3]

bool LDASTools::AL::Thread::IsParentThread ( ) const
inherited

◆ IsParentThread() [3/3]

bool LDASTools::AL::Thread::IsParentThread ( ) const
inherited

◆ Join() [1/3]

void LDASTools::AL::Thread::Join ( )
virtualinherited

◆ Join() [2/3]

virtual void LDASTools::AL::Thread::Join ( )
virtualinherited

◆ Join() [3/3]

virtual void LDASTools::AL::Thread::Join ( )
virtualinherited

◆ Kill() [1/3]

int LDASTools::AL::Thread::Kill ( signal_type  Signal) const
inherited

◆ Kill() [2/3]

int LDASTools::AL::Thread::Kill ( signal_type  Signal) const
inherited

◆ Kill() [3/3]

int LDASTools::AL::Thread::Kill ( signal_type  Signal) const
inherited

◆ Message() [1/3]

void LDASTools::AL::Log::Message ( const group_type  Group,
const level_type  Level,
const std::string &  Message 
)

Send a message to the log.

Parameters
[in]GroupThe group associated with the message.
[in]LevelThe level associated with the message.
[in]MessageThe text of the message.

This member first determins if the Message should be logged based on the Level for the Group. If it should be logged, it will be added to the message queue in a thread safe manner. Another thread is responsible for actually outputting the queue of messages to the log stream.

◆ Message() [2/3]

void LDASTools::AL::Log::Message ( const group_type  Group,
const level_type  Level,
const std::string &  Message 
)

Send a message to the log.

Parameters
[in]GroupThe group associated with the message.
[in]LevelThe level associated with the message.
[in]MessageThe text of the message.

◆ Message() [3/3]

void LDASTools::AL::Log::Message ( const group_type  Group,
const level_type  Level,
const std::string &  Message 
)

Send a message to the log.

Parameters
[in]GroupThe group associated with the message.
[in]LevelThe level associated with the message.
[in]MessageThe text of the message.

◆ onStreamClose() [1/3]

virtual void LDASTools::AL::Log::onStreamClose ( )
protectedvirtual

Hook to do additional action when the stream is closed.

◆ onStreamClose() [2/3]

void LDASTools::AL::Log::onStreamClose ( )
protectedvirtual

Hook to do additional action when the stream is closed.

By default, there is no special action that needs to take place when the file is closed.

◆ onStreamClose() [3/3]

virtual void LDASTools::AL::Log::onStreamClose ( )
protectedvirtual

Hook to do additional action when the stream is closed.

◆ onStreamOpen() [1/3]

void LDASTools::AL::Log::onStreamOpen ( )
protectedvirtual

Hook to do additional action when the stream is opened.

By default, there is no special action that needs to take place when the file is opened.

◆ onStreamOpen() [2/3]

virtual void LDASTools::AL::Log::onStreamOpen ( )
protectedvirtual

Hook to do additional action when the stream is opened.

◆ onStreamOpen() [3/3]

virtual void LDASTools::AL::Log::onStreamOpen ( )
protectedvirtual

Hook to do additional action when the stream is opened.

◆ operator==() [1/3]

bool LDASTools::AL::Thread::operator== ( const Thread Source) const
inherited

◆ operator==() [2/3]

bool LDASTools::AL::Thread::operator== ( const Thread Source) const
inherited

◆ operator==() [3/3]

bool LDASTools::AL::Thread::operator== ( const Thread Source) const
inherited

◆ ParentThread() [1/3]

Thread::thread_type LDASTools::AL::Thread::ParentThread ( ) const
inlineinherited

Retrieve key for parent thread.

◆ ParentThread() [2/3]

thread_type LDASTools::AL::Thread::ParentThread ( ) const
inherited

Retrieve key for parent thread.

◆ ParentThread() [3/3]

thread_type LDASTools::AL::Thread::ParentThread ( ) const
inherited

Retrieve key for parent thread.

◆ purge() [1/3]

void LDASTools::AL::Log::purge ( )
protected

Flush the output queue.

◆ purge() [2/3]

void LDASTools::AL::Log::purge ( )
protected

Flush the output queue.

Send all output to the open log file.

◆ purge() [3/3]

void LDASTools::AL::Log::purge ( )
protected

Flush the output queue.

◆ SelfCancellationCheck() [1/3]

static void LDASTools::AL::Thread::SelfCancellationCheck ( const std::string &  Header,
const char *  File,
const int  Line 
)
staticinherited

◆ SelfCancellationCheck() [2/3]

static void LDASTools::AL::Thread::SelfCancellationCheck ( const std::string &  Header,
const char *  File,
const int  Line 
)
staticinherited

◆ SelfCancellationCheck() [3/3]

static void LDASTools::AL::Thread::SelfCancellationCheck ( const std::string &  Header,
const char *  File,
const int  Line 
)
staticinherited

◆ SignalCapture() [1/3]

void LDASTools::AL::Thread::SignalCapture ( SignalHandler::signal_type  Sig)
inherited

◆ SignalCapture() [2/3]

void LDASTools::AL::Thread::SignalCapture ( signal_type  Sig)
inherited

◆ SignalCapture() [3/3]

void LDASTools::AL::Thread::SignalCapture ( signal_type  Sig)
inherited

◆ SignalIgnore() [1/3]

void LDASTools::AL::Thread::SignalIgnore ( signal_type  Sig)
inherited

◆ SignalIgnore() [2/3]

void LDASTools::AL::Thread::SignalIgnore ( signal_type  Sig)
inherited

◆ SignalIgnore() [3/3]

void LDASTools::AL::Thread::SignalIgnore ( SignalHandler::signal_type  Sig)
inherited

◆ Spawn() [1/3]

virtual int LDASTools::AL::Thread::Spawn ( )
virtualinherited

◆ Spawn() [2/3]

virtual int LDASTools::AL::Thread::Spawn ( )
virtualinherited

◆ Spawn() [3/3]

int LDASTools::AL::Thread::Spawn ( )
virtualinherited

◆ spawn() [1/3]

int LDASTools::AL::Thread::spawn ( start_function_type  StartFunction = (start_function_typestart_routine)
protectedinherited

Spawn a new thread.

Parameters
[in]StartFunctionThe routine for the new thread to start.

◆ spawn() [2/3]

int LDASTools::AL::Thread::spawn ( start_function_type  StartFunction = (start_function_typestart_routine)
protectedinherited

Spawn a new thread.

Parameters
[in]StartFunctionThe routine for the new thread to start.

◆ spawn() [3/3]

int LDASTools::AL::Thread::spawn ( start_function_type  StartFunction = (start_function_typestart_routine)
protectedinherited

Spawn a new thread.

Parameters
[in]StartFunctionThe routine for the new thread to start.

◆ StackSizeDefault() [1/6]

static size_t LDASTools::AL::Thread::StackSizeDefault ( )
staticinherited

◆ StackSizeDefault() [2/6]

static size_t LDASTools::AL::Thread::StackSizeDefault ( )
staticinherited

◆ StackSizeDefault() [3/6]

size_t LDASTools::AL::Thread::StackSizeDefault ( )
inlinestaticinherited

◆ StackSizeDefault() [4/6]

static void LDASTools::AL::Thread::StackSizeDefault ( size_t  StackSize)
staticinherited

◆ StackSizeDefault() [5/6]

void LDASTools::AL::Thread::StackSizeDefault ( size_t  StackSize)
staticinherited

Establish the default value of the stack size used when creating new threads. This routine does validate the requested value..

◆ StackSizeDefault() [6/6]

static void LDASTools::AL::Thread::StackSizeDefault ( size_t  StackSize)
staticinherited

◆ Stream() [1/6]

void LDASTools::AL::Log::Stream ( stream_type  Output)

Set the stream to use for output.

Parameters
[in]OutputStream to use for output

◆ Stream() [2/6]

void LDASTools::AL::Log::Stream ( stream_type  Output)

Set the stream to use for output.

Parameters
[in]OutputStream to use for output

◆ Stream() [3/6]

void LDASTools::AL::Log::Stream ( stream_type  Output)

Set the stream to use for output.

Parameters
[in]OutputStream to use for output

◆ Stream() [4/6]

stream_type LDASTools::AL::Log::Stream ( )

◆ Stream() [5/6]

stream_type LDASTools::AL::Log::Stream ( )

◆ Stream() [6/6]

Log::stream_type LDASTools::AL::Log::Stream ( )

◆ Sync() [1/3]

void LDASTools::AL::Log::Sync ( ) const

◆ Sync() [2/3]

void LDASTools::AL::Log::Sync ( ) const

◆ Sync() [3/3]

void LDASTools::AL::Log::Sync ( ) const

◆ threadId() [1/3]

thread_type LDASTools::AL::Thread::threadId ( ) const
protectedinherited

◆ threadId() [2/3]

Thread::thread_type LDASTools::AL::Thread::threadId ( ) const
inlineprotectedinherited

◆ threadId() [3/3]

thread_type LDASTools::AL::Thread::threadId ( ) const
protectedinherited

◆ Verbosity() [1/3]

void LDASTools::AL::Log::Verbosity ( const group_type  Group,
const level_type  Level 
)

Establish logging level for a given group.

Parameters
[in]GroupThe group for which the logging level is to be modified.
[in]LevelThe level of debugging to output.

◆ Verbosity() [2/3]

void LDASTools::AL::Log::Verbosity ( const group_type  Group,
const level_type  Level 
)

Establish logging level for a given group.

Parameters
[in]GroupThe group for which the logging level is to be modified.
[in]LevelThe level of debugging to output.

◆ Verbosity() [3/3]

void LDASTools::AL::Log::Verbosity ( const group_type  Group,
const level_type  Level 
)
inline

Establish logging level for a given group.

Parameters
[in]GroupThe group for which the logging level is to be modified.
[in]LevelThe level of debugging to output.

◆ VerbosityCheck() [1/3]

bool LDASTools::AL::Log::VerbosityCheck ( const group_type  Group,
const level_type  Level 
) const

Check if the message will be logged.

Parameters
[in]GroupThe group for which to check.
[in]LevelThe level to check.

◆ VerbosityCheck() [2/3]

bool LDASTools::AL::Log::VerbosityCheck ( const group_type  Group,
const level_type  Level 
) const

Check if the message will be logged.

Parameters
[in]GroupThe group for which to check.
[in]LevelThe level to check.

◆ VerbosityCheck() [3/3]

bool LDASTools::AL::Log::VerbosityCheck ( const group_type  Group,
const level_type  Level 
) const
inline

Check if the message will be logged.

Parameters
[in]GroupThe group for which to check.
[in]LevelThe level to check.

◆ write_message() [1/3]

void LDASTools::AL::Log::write_message ( const message_queue_entry_type MessageInfo)
private

Write message to the output stream.

This method does the actual writing of the message to the log.

Parameters
[in]MessageInfoThe content to be written to the log.

◆ write_message() [2/3]

void LDASTools::AL::Log::write_message ( const message_queue_entry_type MessageInfo)
private

Write message to the output stream.

Parameters
[in]MessageInfoThe content to be written to the log.

◆ write_message() [3/3]

void LDASTools::AL::Log::write_message ( const message_queue_entry_type MessageInfo)
private

Write message to the output stream.

Parameters
[in]MessageInfoThe content to be written to the log.

Friends And Related Function Documentation

◆ LogCB

LogCB
friend

Member Data Documentation

◆ m_base_name

const std::string LDASTools::AL::Log::m_base_name
private

The base name for the log file. It is used as the pattern for log rotation.

◆ m_entries_max

int LDASTools::AL::Log::m_entries_max
private

Holder for the maximum number of entries that should be written to the stream before rotating. If the value is zero, then it is unlimited.

◆ m_message_baton

MutexLock::baton_type LDASTools::AL::Log::m_message_baton
mutableprivate

Protect integrity of the message queue.

The holder of this resouce has the authority to modify the message queue..

◆ m_message_queue

message_queue_type LDASTools::AL::Log::m_message_queue
private

Storage for pending message.

This storage holds the list of pending mesages.

◆ m_output_queue

message_queue_type LDASTools::AL::Log::m_output_queue
private

Storage for output message.

This storage holds the list of pending output mesages.

◆ m_stream

stream_type LDASTools::AL::Log::m_stream
protected

Active output stream.

◆ m_verbosity

verbose_map_type LDASTools::AL::Log::m_verbosity
mutableprivate

Keep track of the verbosity of each group.

◆ stream_delete_on_destruct

bool LDASTools::AL::Log::stream_delete_on_destruct
protected

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