reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
resip::Log::LocalLoggerMap Class Reference

Thread Local logger settings storage. More...

#include <Log.hxx>

Public Member Functions

 LocalLoggerMap ()
 
LocalLoggerId create (Type type, Level level, const char *logFileName=NULL, ExternalLogger *externalLogger=NULL, MessageStructure messageStructure=Unstructured)
 Create new logger instance and return its ID (zero on error)
 
int reinitialize (LocalLoggerId loggerId, Type type, Level level, const char *logFileName=NULL, ExternalLogger *externalLogger=NULL, MessageStructure messageStructure=Unstructured)
 Reinitialize all new setting for a local logger instance.
 
int remove (LocalLoggerId loggerId)
 Remove existing logger instance from map and destroy.
 
ThreadData * getData (LocalLoggerId loggerId)
 Get pointer to ThreadData for given ID and increase use counter.
 
void decreaseUseCount (LocalLoggerId loggerId)
 Decrease use counter for given loggerId.
 

Protected Types

typedef HashMap< LocalLoggerId, std::pair< ThreadData *, int > > LoggerInstanceMap
 Storage for Thread Local loggers and their use-counts.
 

Protected Attributes

LoggerInstanceMap mLoggerInstancesMap
 
LocalLoggerId mLastLocalLoggerId
 Last used LocalLoggerId.
 
Mutex mLoggerInstancesMapMutex
 Mutex to synchronize access to Thread Local logger settings storage.
 

Detailed Description

Thread Local logger settings storage.

Definition at line 381 of file Log.hxx.

Member Typedef Documentation

◆ LoggerInstanceMap

Storage for Thread Local loggers and their use-counts.

Definition at line 422 of file Log.hxx.

Constructor & Destructor Documentation

◆ LocalLoggerMap()

resip::Log::LocalLoggerMap::LocalLoggerMap ( )
inline

Definition at line 384 of file Log.hxx.

Member Function Documentation

◆ create()

Log::LocalLoggerId Log::LocalLoggerMap::create ( Log::Type  type,
Log::Level  level,
const char *  logFileName = NULL,
ExternalLogger *  externalLogger = NULL,
MessageStructure  messageStructure = Unstructured 
)

Create new logger instance and return its ID (zero on error)

Definition at line 998 of file Log.cxx.

◆ decreaseUseCount()

void Log::LocalLoggerMap::decreaseUseCount ( Log::LocalLoggerId  loggerId)

Decrease use counter for given loggerId.

Definition at line 1067 of file Log.cxx.

◆ getData()

Log::ThreadData * Log::LocalLoggerMap::getData ( Log::LocalLoggerId  loggerId)

Get pointer to ThreadData for given ID and increase use counter.

Returns
NULL if ID does not exist.

Definition at line 1054 of file Log.cxx.

◆ reinitialize()

int Log::LocalLoggerMap::reinitialize ( Log::LocalLoggerId  loggerId,
Log::Type  type,
Log::Level  level,
const char *  logFileName = NULL,
ExternalLogger *  externalLogger = NULL,
MessageStructure  messageStructure = Unstructured 
)

Reinitialize all new setting for a local logger instance.

Return values
0on success
1if logger does not exist

Definition at line 1013 of file Log.cxx.

◆ remove()

int Log::LocalLoggerMap::remove ( Log::LocalLoggerId  loggerId)

Remove existing logger instance from map and destroy.

Return values
0on success
1if logger does not exist
2if logger is still in use
>2on other failures

Definition at line 1033 of file Log.cxx.

Member Data Documentation

◆ mLastLocalLoggerId

LocalLoggerId resip::Log::LocalLoggerMap::mLastLocalLoggerId
protected

Last used LocalLoggerId.

Definition at line 425 of file Log.hxx.

◆ mLoggerInstancesMap

LoggerInstanceMap resip::Log::LocalLoggerMap::mLoggerInstancesMap
protected

Definition at line 423 of file Log.hxx.

◆ mLoggerInstancesMapMutex

Mutex resip::Log::LocalLoggerMap::mLoggerInstancesMapMutex
protected

Mutex to synchronize access to Thread Local logger settings storage.

Definition at line 427 of file Log.hxx.


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