Adaptyst
A comprehensive and architecture-agnostic performance analysis tool
Loading...
Searching...
No Matches
print.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 CERN
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
4#ifndef PRINT_HPP_
5#define PRINT_HPP_
6
7#include "system.hpp"
8#include <mutex>
9#include <string>
10#include <utility>
11
12namespace adaptyst {
13 class Terminal {
14 private:
15 std::mutex mutex;
16 std::mutex log_mutex;
17 bool batch;
18 bool formatted;
19 int last_line_len;
20 std::string version;
21 std::unordered_map<Identifiable *,
22 std::unordered_map<std::string, std::pair<std::shared_ptr<std::mutex>,
23 std::ofstream> > > log_streams;
24 fs::path log_dir;
25 Terminal(bool batch, bool formatted, std::string version,
26 fs::path log_dir);
27
28 public:
29 static std::unique_ptr<Terminal> instance;
30 static void init(bool batch, bool formatted, std::string version,
31 fs::path log_dir);
32
33 void print_notice();
34 void log(std::string message, Identifiable *source,
35 std::string log_type);
36 void print(std::string message, bool sub, bool error,
37 bool same_line = false);
38 void print(std::string message, bool sub, bool error,
39 Identifiable *source, std::string log_type);
40 const char *get_log_dir();
41 void set_log_dir(fs::path log_dir);
42 };
43};
44
45#endif
Definition system.hpp:21
static void init(bool batch, bool formatted, std::string version, fs::path log_dir)
Definition print.cpp:11
void print_notice()
Definition print.cpp:44
void log(std::string message, Identifiable *source, std::string log_type)
Definition print.cpp:54
const char * get_log_dir()
Definition print.cpp:154
static std::unique_ptr< Terminal > instance
Definition print.hpp:29
void set_log_dir(fs::path log_dir)
Definition print.cpp:158
void print(std::string message, bool sub, bool error, bool same_line=false)
Definition print.cpp:115
Definition archive.cpp:7