| helics 3.6.1

logging.hpp
Go to the documentation of this file.
1 /*
2 Copyright (c) 2017-2025,
3 Battelle Memorial Institute; Lawrence Livermore National Security, LLC; Alliance for Sustainable
4 Energy, LLC. See the top-level NOTICE for additional details. All rights reserved.
5 SPDX-License-Identifier: BSD-3-Clause
6 */
7 #pragma once
8
9 #include "../helics_enums.h"
10
11 #include <string>
12 #include <unordered_map>
13
14 namespace helics {
20 enum LogLevels : int {
21 DUMPLOG = HELICS_LOG_LEVEL_DUMPLOG,
22 NO_PRINT = HELICS_LOG_LEVEL_NO_PRINT,
23 ERROR_LEVEL = HELICS_LOG_LEVEL_ERROR,
24 PROFILING = HELICS_LOG_LEVEL_PROFILING,
25 WARNING = HELICS_LOG_LEVEL_WARNING,
26 SUMMARY = HELICS_LOG_LEVEL_SUMMARY,
27 CONNECTIONS =
28 HELICS_LOG_LEVEL_CONNECTIONS,
29 INTERFACES =
30 HELICS_LOG_LEVEL_INTERFACES,
31 TIMING = HELICS_LOG_LEVEL_TIMING,
32 DATA = HELICS_LOG_LEVEL_DATA,
33 DEBUG = HELICS_LOG_LEVEL_DEBUG,
34 TRACE = HELICS_LOG_LEVEL_TRACE,
35 FED = 99999
36 };
37
38 extern const std::unordered_map<std::string, int> gLogLevelMap;
39
40 LogLevels logLevelFromString(std::string_view level);
41
42 std::string logLevelToString(LogLevels level);
43
44 } // namespace helics
HELICS_LOG_LEVEL_ERROR
@ HELICS_LOG_LEVEL_ERROR
Definition: helics_enums.h:208
HELICS_LOG_LEVEL_SUMMARY
@ HELICS_LOG_LEVEL_SUMMARY
Definition: helics_enums.h:214
HELICS_LOG_LEVEL_CONNECTIONS
@ HELICS_LOG_LEVEL_CONNECTIONS
Definition: helics_enums.h:217
HELICS_LOG_LEVEL_DEBUG
@ HELICS_LOG_LEVEL_DEBUG
Definition: helics_enums.h:225
HELICS_LOG_LEVEL_NO_PRINT
@ HELICS_LOG_LEVEL_NO_PRINT
Definition: helics_enums.h:206
HELICS_LOG_LEVEL_PROFILING
@ HELICS_LOG_LEVEL_PROFILING
Definition: helics_enums.h:210
HELICS_LOG_LEVEL_DATA
@ HELICS_LOG_LEVEL_DATA
Definition: helics_enums.h:223
HELICS_LOG_LEVEL_INTERFACES
@ HELICS_LOG_LEVEL_INTERFACES
Definition: helics_enums.h:219
HELICS_LOG_LEVEL_DUMPLOG
@ HELICS_LOG_LEVEL_DUMPLOG
Definition: helics_enums.h:204
HELICS_LOG_LEVEL_TIMING
@ HELICS_LOG_LEVEL_TIMING
Definition: helics_enums.h:221
HELICS_LOG_LEVEL_TRACE
@ HELICS_LOG_LEVEL_TRACE
Definition: helics_enums.h:227
HELICS_LOG_LEVEL_WARNING
@ HELICS_LOG_LEVEL_WARNING
Definition: helics_enums.h:212
helics
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14
helics::LogLevels
LogLevels
Definition: logging.hpp:20
helics::ERROR_LEVEL
@ ERROR_LEVEL
only print errors
Definition: logging.hpp:23
helics::PROFILING
@ PROFILING
profiling log level
Definition: logging.hpp:24
helics::SUMMARY
@ SUMMARY
print/log summary information
Definition: logging.hpp:26
helics::WARNING
@ WARNING
print/log warning and errors
Definition: logging.hpp:25
helics::DATA
@ DATA
print timing+data transmissions
Definition: logging.hpp:32
helics::DEBUG
@ DEBUG
print data+additional debug info
Definition: logging.hpp:33
helics::NO_PRINT
@ NO_PRINT
never print
Definition: logging.hpp:22
helics::CONNECTIONS
@ CONNECTIONS
print summary+federate level connection information
Definition: logging.hpp:27
helics::INTERFACES
@ INTERFACES
print connections+interface level connection information
Definition: logging.hpp:29
helics::TIMING
@ TIMING
print interfaces+timing(exec/grant/disconnect)
Definition: logging.hpp:31
helics::FED
@ FED
special logging command for message coming from a fed
Definition: logging.hpp:35
helics::TRACE
@ TRACE
trace level printing (all processed messages)
Definition: logging.hpp:34
helics::DUMPLOG
@ DUMPLOG
only for dumplog
Definition: logging.hpp:21