|
FE 0.13.1
Header-only C++ frontend library
|
Facility to log what you are doing. More...
#include <fe/log.h>
Classes | |
| struct | FmtLoc |
| A std::format_string that remembers where it was written. More... | |
Public Types | |
| enum class | Level { Error , Warn , Info , Verbose , Debug , Trace } |
| template<class... Args> | |
| using | Fmt = FmtLoc<std::type_identity_t<Args>...> |
| Puts the Args of a Log::FmtLoc parameter into a non-deduced context, so that they are deduced from the trailing arguments and the format string keeps capturing its call site. | |
Public Member Functions | |
Getters | |
| Level | level () const |
| std::ostream & | ostream () const |
| operator bool () const | |
| Checks if Log::ostream_ is set. | |
Setters | |
| Log & | set (std::ostream *ostream) |
| Log & | set (Level max_level) |
Log | |
Output | |
| template<class... Args> | |
| void | log (Level level, Loc loc, std::format_string< Args... > fmt, Args &&... args) const |
| template<class... Args> | |
| void | log (Level level, std::source_location where, std::format_string< Args... > fmt, Args &&... args) const |
| A std::source_location is no Loc: it points into your source, which has no fe::Src. | |
| template<class... Args> | |
| void | log (Level level, Fmt< Args... > fmt, Args &&... args) const |
| Points at the call site. | |
Level Shorthands | |
| template<class... Args> | |
| void | e (Fmt< Args... > fmt, Args &&... args) const |
| template<class... Args> | |
| void | w (Fmt< Args... > fmt, Args &&... args) const |
| template<class... Args> | |
| void | i (Fmt< Args... > fmt, Args &&... args) const |
| template<class... Args> | |
| void | v (Fmt< Args... > fmt, Args &&... args) const |
Debug Shorthands | |
Vaporize to nothingness in Release build; the arguments are still evaluated. | |
| template<class... Args> | |
| void | d (Fmt< Args... > fmt, Args &&... args) const |
| template<class... Args> | |
| void | t (Fmt< Args... > fmt, Args &&... args) const |
Static Public Member Functions | |
Conversions | |
| static char | level2acro (Level level) |
| static term::FG | level2color (Level level) |
Public Attributes | |
Breakpoints | |
| bool | break_on_error = false |
| bool | break_on_warn = false |
| using fe::Log::Fmt = FmtLoc<std::type_identity_t<Args>...> |
Puts the Args of a Log::FmtLoc parameter into a non-deduced context, so that they are deduced from the trailing arguments and the format string keeps capturing its call site.
|
strong |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 26 of file log.h.
Referenced by level2acro(), level2color(), log(), log(), and log().
|
inlinestatic |
Definition at line 148 of file log.h.
References fe::term::Blue, fe::term::Cyan, Debug, Error, fe::term::Green, Info, level(), fe::term::Magenta, fe::term::Red, Trace, fe::unreachable(), Verbose, Warn, and fe::term::Yellow.
|
inline |
Points at the call site.
Definition at line 81 of file log.h.
References fe::Log::FmtLoc< Args >::fmt, level(), fe::Log::FmtLoc< Args >::loc, and log().
|
inline |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |