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: 2025 CERN
2// SPDX-License-Identifier: GPL-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
11namespace adaptyst {
12 class Terminal {
13 private:
14 std::mutex mutex;
15 std::mutex log_mutex;
16 bool batch;
17 bool formatted;
18 int last_line_len;
19 std::string version;
20 std::unordered_map<Identifiable *,
21 std::unordered_map<std::string, std::ofstream> > log_streams;
22 fs::path log_dir;
23 Terminal(bool batch, bool formatted, std::string version,
24 fs::path log_dir);
25
26 public:
27 static std::unique_ptr<Terminal> instance;
28 static void init(bool batch, bool formatted, std::string version,
29 fs::path log_dir);
30
31 void print_notice();
32 void log(std::string message, Identifiable *source,
33 std::string log_type);
34 void print(std::string message, bool sub, bool error,
35 bool same_line = false);
36 void print(std::string message, bool sub, bool error,
37 Identifiable *source, std::string log_type);
38 const char *get_log_dir();
39 void set_log_dir(fs::path log_dir);
40 };
41};
42
43#endif
Definition system.hpp:23
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:146
static std::unique_ptr< Terminal > instance
Definition print.hpp:27
void set_log_dir(fs::path log_dir)
Definition print.cpp:150
void print(std::string message, bool sub, bool error, bool same_line=false)
Definition print.cpp:107
Definition output.hpp:12