mirror of
https://github.com/usatiuk/backup.git
synced 2025-10-26 17:37:47 +01:00
proper cmake
This commit is contained in:
19
src/utils/srcs/Logger.cpp
Normal file
19
src/utils/srcs/Logger.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// Created by Stepan Usatiuk on 23.05.2023.
|
||||
//
|
||||
|
||||
#include "../includes/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;
|
||||
}
|
||||
Reference in New Issue
Block a user