Class AbstractLogger#
A class that allows you to log events to where they need to go.
#include <abstractlogger.h>
Public Types#
Type | Name |
---|---|
enum | Channel |
enum | Target |
Public Functions#
Type | Name |
---|---|
AbstractLogger (Channel channel=Info, int targets=Default) |
|
AbstractLogger (QString & str, Channel channel, int additionalTargets=String) Construct an AbstractLogger with output to a string. |
|
AbstractLogger & | addOutputString (QString & str) |
AbstractLogger & | attachNotificationPath (const QString & path) Attach a path to a notification so it can be dragged and dropped. |
AbstractLogger & | enableMessageHeader (bool enable) Enable/disable message header (e.g. "flameshot: info:"). |
AbstractLogger & | operator<< (const QString & msg) Send a message to the default channel of this logger. |
AbstractLogger & | sendMessage (const QString & msg, Channel channel) |
~AbstractLogger () |
Public Static Functions#
Type | Name |
---|---|
AbstractLogger | error (int targets=Default) |
AbstractLogger | info (int targets=Default) |
AbstractLogger | warning (int targets=Default) |
Public Types Documentation#
enum Channel#
enum AbstractLogger::Channel {
Info,
Warning,
Error
};
enum Target#
enum AbstractLogger::Target {
Notification = 0x01,
Stderr = 0x02,
LogFile = 0x08,
String = 0x10,
Stdout = 0x20,
Default = Notification | LogFile | Stderr
};
Public Functions Documentation#
function AbstractLogger [1/2]#
AbstractLogger::AbstractLogger (
Channel channel=Info,
int targets=Default
)
function AbstractLogger [2/2]#
Construct an AbstractLogger with output to a string.
AbstractLogger::AbstractLogger (
QString & str,
Channel channel,
int additionalTargets=String
)
Parameters:
additionalChannels
Optional additional targets to output to.
function addOutputString#
AbstractLogger & AbstractLogger::addOutputString (
QString & str
)
function attachNotificationPath#
AbstractLogger & AbstractLogger::attachNotificationPath (
const QString & path
)
function enableMessageHeader#
AbstractLogger & AbstractLogger::enableMessageHeader (
bool enable
)
function operator<<#
Send a message to the default channel of this logger.
AbstractLogger & AbstractLogger::operator<< (
const QString & msg
)
Parameters:
msg
Returns:
function sendMessage#
AbstractLogger & AbstractLogger::sendMessage (
const QString & msg,
Channel channel
)
function ~AbstractLogger#
AbstractLogger::~AbstractLogger ()
Public Static Functions Documentation#
function error#
static AbstractLogger AbstractLogger::error (
int targets=Default
)
function info#
static AbstractLogger AbstractLogger::info (
int targets=Default
)
function warning#
static AbstractLogger AbstractLogger::warning (
int targets=Default
)