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;
75 const std::string&
name()
const;
80 return atomicGet(_loglevel);
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;
168 #endif // Pt_System_LogTarget_h
Core module.
Definition: pt-gfx-images.dox:14
Target of log-messages.
Definition: LogTarget.h:63
Log records can be added to a log.
Definition: LogRecord.h:91
Logging channel.
Definition: LogChannel.h:52
void setLogLevel(LogLevel level)
Sets the log-level of the target and its children.
void reset()
Resets log level and channel.
const std::string & name() const
Returns the name of the target.
std::string channelUrl() const
Returns the URL of the channel used by the target.
virtual ~LogTarget()
Destructor.
void setChannel(const std::string &url)
Sets the channel to be used by this target.
Protects derived classes from being copied.
Definition: NonCopyable.h:54
static LogTarget & get(const std::string &name)
Get a target from the logging manager.
Atomic integers to be used with atomicity functions.
Definition: Atomicity.h:51
int logLevel() const
Returns the log level of the target.
Definition: LogTarget.h:78
LogLevel
Severity of the log-message.
Definition: LogLevel.h:41
void log(const LogRecord &record)
Write log record to this target.