29#ifndef Pt_System_LogTarget_h
30#define Pt_System_LogTarget_h
32#include <Pt/System/Api.h>
33#include <Pt/System/LogLevel.h>
34#include <Pt/NonCopyable.h>
35#include <Pt/Atomicity.h>
64 friend class LogManager;
68 LogTarget(
const std::string&
name, LogTarget* parent = 0);
75 const std::string&
name()
const;
118 static LogTarget&
get(
const std::string&
name);
122 LogTarget* parent()
const
126 bool inheritsLogLevel()
const;
129 void assignLogLevel(
int level,
bool inherited);
132 bool inheritsChannel()
const;
139 void removeChannel();
142 void assignChannel(LogChannel& ch);
152 mutable volatile atomic_t _loglevel;
155 bool _inheritLogLevel;
158 LogChannel* _channel;
161 bool _inheritChannel;
Base class that disables copy construction and assignment.
Definition NonCopyable.h:59
Logging channel.
Definition LogChannel.h:52
Log records can be added to a log.
Definition LogRecord.h:94
void setLogLevel(LogLevel level)
Sets the log-level of the target and its children.
const std::string & name() const
Returns the name of the target.
virtual ~LogTarget()
Destructor.
void setChannel(const std::string &url)
Sets the channel to be used by this target.
void log(const LogRecord &record)
Write log record to this target.
static LogTarget & get(const std::string &name)
Get a target from the logging manager.
void reset()
Resets log level and channel.
std::string channelUrl() const
Returns the URL of the channel used by the target.
int logLevel() const
Returns the log level of the target.
Definition LogTarget.h:78
int atomicGet(volatile atomic_t &val)
Atomically get a value.
LogLevel
Severity of the log-message.
Definition LogLevel.h:41
System programming
Definition Connection.h:26
Core module.
Definition Allocator.h:33
Atomic integers to be used with atomicity functions.
Definition Atomicity.h:52