logger.h
// Copyright (c) 1999-2018 David Muse
// See the COPYING file for more information.
#ifndef RUDIMENTS_LOGGER_H
#define RUDIMENTS_LOGGER_H
#include <rudiments/private/loggerincludes.h>
class RUDIMENTS_DLLSPEC logdestination {
#include <rudiments/private/logdestination.h>
};
class RUDIMENTS_DLLSPEC syslogdestination : public logdestination {
public:
syslogdestination();
syslogdestination(const syslogdestination &f);
syslogdestination &operator=(const syslogdestination &f);
virtual ~syslogdestination();
void open(const char *ident, int32_t option,
int32_t facility, int32_t priority);
void close();
#include <rudiments/private/syslogdestination.h>
};
class RUDIMENTS_DLLSPEC filedestination : public logdestination {
public:
filedestination();
filedestination(const filedestination &f);
filedestination &operator=(const filedestination &f);
virtual ~filedestination();
bool open(const char *filename, mode_t perms);
void close();
#include <rudiments/private/filedestination.h>
};
class RUDIMENTS_DLLSPEC stdoutdestination : public logdestination {
#include <rudiments/private/stdoutdestination.h>
};
class RUDIMENTS_DLLSPEC stderrdestination : public logdestination {
#include <rudiments/private/stderrdestination.h>
};
typedef linkedlistnode<logdestination *> loggerlistnode;
typedef linkedlist<logdestination *> loggerlist;
class RUDIMENTS_DLLSPEC logger {
public:
logger();
~logger();
void addLogDestination(logdestination *logdest);
void removeLogDestination(logdestination *logdest);
void removeAllLogDestinations();
void setIndent(char ch);
char getIndent();
void setLogLevel(uint8_t level);
uint8_t getLogLevel();
static char *logHeader(const char *name);
void start(uint8_t level,
const char *header,
uint32_t indent,
const char *string);
void write(uint8_t level,
const char *header,
uint32_t indent,
const char *format, ...);
void write(uint8_t level,
const char *header,
uint32_t indent,
const char *format,
va_list *argp);
void end(uint8_t level,
const char *header,
uint32_t indent);
#include <rudiments/private/logger.h>
};
#endif
filedestination
Definition: logger.h:46
filedestination::operator=
filedestination & operator=(const filedestination &f)
filedestination::close
void close()
filedestination::filedestination
filedestination(const filedestination &f)
filedestination::~filedestination
virtual ~filedestination()
filedestination::filedestination
filedestination()
filedestination::open
bool open(const char *filename, mode_t perms)
linkedlist
Definition: linkedlist.h:60
linkedlistnode
Definition: linkedlist.h:11
logdestination
Definition: logger.h:11
logger
Definition: logger.h:97
logger::removeAllLogDestinations
void removeAllLogDestinations()
logger::logger
logger()
logger::setIndent
void setIndent(char ch)
logger::addLogDestination
void addLogDestination(logdestination *logdest)
logger::logHeader
static char * logHeader(const char *name)
logger::end
void end(uint8_t level, const char *header, uint32_t indent)
logger::write
void write(uint8_t level, const char *header, uint32_t indent, const char *format, va_list *argp)
logger::getLogLevel
uint8_t getLogLevel()
logger::setLogLevel
void setLogLevel(uint8_t level)
logger::~logger
~logger()
logger::removeLogDestination
void removeLogDestination(logdestination *logdest)
logger::getIndent
char getIndent()
logger::start
void start(uint8_t level, const char *header, uint32_t indent, const char *string)
logger::write
void write(uint8_t level, const char *header, uint32_t indent, const char *format,...)
stderrdestination
Definition: logger.h:80
stdoutdestination
Definition: logger.h:74
syslogdestination
Definition: logger.h:16
syslogdestination::open
void open(const char *ident, int32_t option, int32_t facility, int32_t priority)
syslogdestination::close
void close()
syslogdestination::operator=
syslogdestination & operator=(const syslogdestination &f)
syslogdestination::syslogdestination
syslogdestination(const syslogdestination &f)
syslogdestination::syslogdestination
syslogdestination()
syslogdestination::~syslogdestination
virtual ~syslogdestination()