![]() |
ArkScript
A small, fast, functional and scripting language for video games
|
#include <Logger.hpp>
Public Member Functions | |
Logger (std::string name, unsigned debug_level) | |
Construct a new Logger object. | |
unsigned | debugLevel () const |
bool | shouldInfo () const |
bool | shouldDebug () const |
bool | shouldTrace () const |
template<typename... Args> | |
void | info (const char *fmt, Args &&... args) |
Write an info level log using fmtlib. | |
template<typename... Args> | |
void | debug (const char *fmt, Args &&... args) |
Write a debug level log using fmtlib. | |
void | traceStart (std::string &&trace_name) |
void | traceEnd () |
template<typename... Args> | |
void | trace (const char *fmt, Args &&... args) |
Write a trace level log using fmtlib. | |
Private Attributes | |
unsigned | m_debug |
std::string | m_name |
fmt::color | m_pass_color |
std::unordered_map< std::string, std::chrono::time_point< std::chrono::high_resolution_clock > > | m_trace_starts |
std::vector< std::string > | m_active_traces |
Definition at line 24 of file Logger.hpp.
Ark::internal::Logger::Logger | ( | std::string | name, |
unsigned | debug_level ) |
Construct a new Logger object.
name | the pass name, used for logging |
debug_level | debug level |
Definition at line 29 of file Logger.cpp.
References Ark::internal::colors, m_name, and m_pass_color.
|
inline |
Write a debug level log using fmtlib.
Args |
fmt | format string |
args |
Definition at line 65 of file Logger.hpp.
References m_name, m_pass_color, and shouldDebug().
Referenced by Ark::internal::ImportSolver::process(), Ark::internal::MacroProcessor::process(), and Ark::internal::Optimizer::pruneUnusedGlobalVariables().
|
inlinenodiscard |
Definition at line 35 of file Logger.hpp.
References m_debug.
|
inline |
Write an info level log using fmtlib.
Args |
fmt | format string |
args |
Definition at line 48 of file Logger.hpp.
References m_name, m_pass_color, and shouldInfo().
Referenced by Ark::Welder::saveBytecodeToFile().
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
Definition at line 39 of file Logger.hpp.
References m_debug.
Referenced by Ark::internal::MacroProcessor::process(), Ark::internal::NameResolutionPass::process(), Ark::internal::Optimizer::process(), and trace().
|
inline |
Write a trace level log using fmtlib.
Args |
fmt | format string |
args |
Definition at line 98 of file Logger.hpp.
References m_name, m_pass_color, and shouldTrace().
Referenced by Ark::internal::MacroProcessor::process(), Ark::internal::NameResolutionPass::process(), Ark::internal::Optimizer::process(), and traceEnd().
|
inline |
Definition at line 81 of file Logger.hpp.
References m_active_traces, m_trace_starts, and trace().
Referenced by Ark::internal::ImportSolver::parseImport(), Ark::internal::Compiler::process(), Ark::internal::ImportSolver::process(), Ark::internal::IRCompiler::process(), Ark::internal::IROptimizer::process(), Ark::internal::MacroProcessor::process(), Ark::internal::NameResolutionPass::process(), Ark::internal::Optimizer::process(), and Ark::internal::Parser::process().
|
inline |
Definition at line 75 of file Logger.hpp.
References m_active_traces, and m_trace_starts.
Referenced by Ark::internal::ImportSolver::parseImport(), Ark::internal::Compiler::process(), Ark::internal::ImportSolver::process(), Ark::internal::IRCompiler::process(), Ark::internal::IROptimizer::process(), Ark::internal::MacroProcessor::process(), Ark::internal::NameResolutionPass::process(), Ark::internal::Optimizer::process(), and Ark::internal::Parser::process().
|
private |
Definition at line 113 of file Logger.hpp.
Referenced by traceEnd(), and traceStart().
|
private |
Definition at line 109 of file Logger.hpp.
Referenced by debugLevel(), shouldDebug(), shouldInfo(), and shouldTrace().
|
private |
|
private |
|
private |
Definition at line 112 of file Logger.hpp.
Referenced by traceEnd(), and traceStart().