patrick
/
plasp
Archived
1
0
Fork 0
This repository has been archived on 2023-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
plasp/lib/colorlog/include/colorlog/Logger.h

54 lines
1.4 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef __COLOR_LOG__LOGGER_H
#define __COLOR_LOG__LOGGER_H
#include <string>
#include <colorlog/ColorStream.h>
#include <colorlog/Priority.h>
#include <tokenize/Location.h>
namespace colorlog
{
////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Logger
//
////////////////////////////////////////////////////////////////////////////////////////////////////
class Logger
{
public:
explicit Logger();
explicit Logger(ColorStream &&outputStream);
explicit Logger(ColorStream &&outputStream, ColorStream &&errorStream);
ColorStream &outputStream();
ColorStream &errorStream();
// The priority from which on messages should be printed
void setLogPriority(Priority logPriority);
// Messages with this priority (or higher) will terminate the programs execution
void setAbortPriority(Priority abortPriority);
void setColorPolicy(ColorStream::ColorPolicy colorPolicy);
void log(Priority priority, const char *message);
void log(Priority priority, const std::string &message);
void log(Priority priority, const tokenize::Location &location, const char *message);
void log(Priority priority, const tokenize::Location &location, const std::string &message);
private:
ColorStream m_outputStream;
ColorStream m_errorStream;
Priority m_logPriority;
Priority m_abortPriority;
};
////////////////////////////////////////////////////////////////////////////////////////////////////
}
#endif