Class SysLogInitializer

Synopsis

#include <src/easylogging++.h>

class SysLogInitializer

Description

Initializes syslog with process ID, options and facility. calls closelog() on d'tor.

Mentioned in

Methods

SysLogInitializer
~SysLogInitializer

Source

Lines 3637-3654 in src/easylogging++.h.

class SysLogInitializer {
 public:
  SysLogInitializer(const char* processIdent, int options = 0, int facility = 0) {
#if defined(ELPP_SYSLOG)
    (void)base::consts::kSysLogLoggerId;
    openlog(processIdent, options, facility);
#else
    ELPP_UNUSED(processIdent);
    ELPP_UNUSED(options);
    ELPP_UNUSED(facility);
#endif  // defined(ELPP_SYSLOG)
  }
  virtual ~SysLogInitializer(void) {
#if defined(ELPP_SYSLOG)
    closelog();
#endif  // defined(ELPP_SYSLOG)
  }
};





Add Discussion

Log in to comment