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
11#include "simodo/inout/convert/functions.h"
12
13#include <iostream>
14#include <mutex>
15
16namespace simodo::inout
17{
18void ConsoleReporter::report(const SeverityLevel level, const Location &, const std::string &briefly, const std::string &atlarge)
19{
20static std::mutex console_output_mutex;
21
22if (level >= _max_severity_level)
23{
24std::lock_guard locker(console_output_mutex);
25
26std::cout << getSeverityLevelName(level) << briefly << std::endl;
27if (!atlarge.empty())
28std::cout << atlarge << std::endl;
29}
30
31_max_report_level = std::max(_max_severity_level,level);
32}
33
34}