loom
1/*
2MIT License
3
4Copyright (c) 2021 МГТУ им. Н.Э. Баумана, кафедра ИУ-6, Михаил Фетисов,
5
6https://bmstu.codes/lsx/simodo
7*/
8
9#include "simodo/inout/reporter/ConsoleReporter.h"
10#include "simodo/inout/convert/functions.h"
11
12#include <iostream>
13#include <mutex>
14
15namespace simodo::inout
16{
17void ConsoleReporter::report(const SeverityLevel level, const Location &, const std::string &briefly, const std::string &atlarge) const
18{
19static std::mutex console_output_mutex;
20
21if (level >= _max_severity_level)
22{
23std::lock_guard locker(console_output_mutex);
24
25std::cout << getSeverityLevelName(level) << briefly << std::endl;
26if (!atlarge.empty())
27std::cout << atlarge << std::endl;
28}
29
30_max_report_level = std::max(_max_severity_level,level);
31}
32
33}