mirror of
https://github.com/usatiuk/backup.git
synced 2025-10-26 09:27:48 +01:00
20 lines
392 B
C++
20 lines
392 B
C++
//
|
|
// Created by Stepan Usatiuk on 23.05.2023.
|
|
//
|
|
|
|
#include "Logger.h"
|
|
|
|
Logger::Logger(int level, std::ostream &out) : loglevel(level), out(out) {
|
|
}
|
|
|
|
void Logger::write(const std::string &what, int whatlevel) {
|
|
if (whatlevel <= loglevel) {
|
|
std::lock_guard outLock(outM);
|
|
out.get() << what << std::flush;
|
|
}
|
|
}
|
|
|
|
void Logger::setLevel(int level) {
|
|
loglevel = level;
|
|
}
|