42 #ifndef _DWMSYSLOGGER_HH_ 43 #define _DWMSYSLOGGER_HH_ 83 static bool Open(
const char *ident,
int logopt,
int facility);
91 static bool Open(
const char *ident,
int logopt,
92 const std::string & facility);
107 static bool Log(
int priority,
const char *message, ...);
114 static bool Log(
const std::string & filename,
int lineno,
115 const std::string &
function,
int priority,
116 const char *message, ...);
122 static bool VaLog(
int priority,
const std::string & message,
131 static bool VaLog(
const std::string & filename,
int lineno,
132 const std::string &
function,
int priority,
133 const std::string & message, va_list & vaList);
215 static std::mutex _mutex;
217 static int _logOptions;
218 static std::string _ident;
219 static int _logFacility;
220 static bool _showPriorities;
221 static bool _showFunction;
222 static bool _showFileLocation;
223 static int _minimumPriority;
224 static std::map<int,std::string> _priorityTags;
225 static std::map<std::string,int> _priorityNames;
236 #define Syslog(...) \ 237 Dwm::SysLogger::Log(__FILE__,__LINE__,__PRETTY_FUNCTION__,__VA_ARGS__) 240 #endif // _DWMSYSLOGGER_HH_ static bool Close()
Closes the logger.
static bool ShowFileLocation()
If the logger is set to show file location information in Log(const std::string &, int, int, const char *, ...), returns true.
static int PriorityValue(const std::string &name)
Returns the priority value for the given priority name.
This class encapsulates syslog logging in global scope (all members are static).
Definition: DwmSysLogger.hh:62
static bool ShowFunction()
If the logger is set to show function information in Log(const string &, int, const string &...
static bool VaLog(int priority, const std::string &message, va_list &vaList)
Just like vsyslog(), takes a priority and a format string and a va_list.
static bool Log(int priority, const char *message,...)
Just like syslog(), takes a priority and a format string and variable list of arguments.
Definition: DwmBZ2IO.hh:67
static bool ShowPriorities()
If the logger is set to show priorities in each log message, returns true.
static bool Open(const char *ident, int logopt, int facility)
Opens the logger for syslog logging.
static std::string PriorityTag(int priority)
Returns the priority tag ("[F]", "[W]", et.
static int MinimumPriority()
Returns the lowest message priority that the logger will log.