// vim:fileencoding=utf-8:foldmethod=marker

#ifndef LOG_H
#define LOG_H

#include "../os/file/file.h"
#include "../base/strings/str8/str8.h"

typedef enum {
	WP_LOG_LEVEL_FATAL,
	WP_LOG_LEVEL_CRITICAL,
	WP_LOG_LEVEL_ERROR,
	WP_LOG_LEVEL_WARNING,
	WP_LOG_LEVEL_INFO,
	WP_LOG_LEVEL_DEBUG,

	COUNT_LOG_LEVEL,
} WpLogLevel;

typedef struct {
	WpStr8 name;
} WpLogger;

void wpLogSetLevel(WpLogLevel level);
void wpLogConfigure(WpFile *outlog, WpFile *errlog, WpLogLevel level);
WpLogger wpLogMakeLogger(WpStr8 name);
void wpLogDebug(const WpLogger *logger, WpStr8 msg);
void wpLogInfo(const WpLogger *logger, WpStr8 msg);
void wpLogWarning(const WpLogger *logger, WpStr8 msg);
void wpLogError(const WpLogger *logger, WpStr8 msg);
void wpLogCritical(const WpLogger *logger, WpStr8 msg);
void wpLogFatal(const WpLogger *logger, WpStr8 msg);

#endif // !LOG_H
