40#include "tkn_config.h"
56 static std::recursive_mutex& get_mutex() {
57 static std::recursive_mutex mutex;
61 static thread_local tklog *g_log;
183 { (*pf)(*this);
return (*
this); }
187 if(fskiplog)
return (*
this);
193 if(fskiplog)
return (*
this);
194 std::lock_guard<std::recursive_mutex> lock(get_mutex());
202 void set_type(
bType _type);
203 void process_color();
225 std::lock_guard<std::recursive_mutex> lock(log.get_mutex());
238 std::lock_guard<std::recursive_mutex> lock(log.get_mutex());
240 std::cout<<std::endl;
250 log.
reset();
return log;
442#define glog (*tkn::tklog::the_log())
445#define gdebug glog << debug
447#define gdebug if(0) glog << debug
Classe used to print debugs, infos, warnings and errors into the terminal.
friend tklog & error_vo(tklog &)
friend tklog & info_o(tklog &)
void progress_bar(int _max, int _value, const tkstring &_message="")
friend tklog & regular(tklog &)
Attributes.
virtual tklog & operator<<(tklog &(*pf)(tklog &))
To allow manipulators.
tklog & operator<<(T t)
send any request to the underlying ostringstream
friend tklog & purple_bg(tklog &)
friend tklog & purple(tklog &)
friend tklog & reset(tklog &)
To print the current message, then reset the log.
friend tklog & cyan_bg(tklog &)
friend tklog & underline(tklog &)
void set_warnings(bool _print_warnings=true)
friend tklog & error_o(tklog &)
void set_class(tkstring _class_name)
friend tklog & do_log(tklog &)
To print the current message, then reset the log.
friend tklog & skip_line(tklog &)
Reset the log style.
friend tklog & info(tklog &)
friend tklog & debug(tklog &log)
friend tklog & yellow(tklog &)
friend tklog & comment(tklog &)
std::ostringstream fCore_message
Contains the type string to be printed with the current style.
friend tklog & blue_bg(tklog &)
friend tklog & blue(tklog &)
friend tklog & cyan(tklog &)
friend tklog & white(tklog &)
friend tklog & warning_o(tklog &)
friend tklog & error_v(tklog &)
friend tklog & high_intensity(tklog &)
Colors.
friend tklog & black(tklog &)
friend tklog & warning(tklog &)
friend tklog & green(tklog &)
friend tklog & red(tklog &)
friend tklog & black_bg(tklog &)
std::ostringstream fType_message
friend tklog & do_endl(tklog &)
General.
bool fHigh_intensity_colors
void set_method(tkstring _method_name)
tkstring fClass
To put back the standard font in std::cout.
friend tklog & info_v(tklog &)
Predefined macros with verbose option (print the name of the class and method)
friend tklog & green_bg(tklog &)
tklog & operator<<(std::basic_ostream< char > o)
friend tklog & italic(tklog &)
friend tklog & white_bg(tklog &)
static tklog * the_log()
glog is a singleton used for fancy prints in the terminal
friend tklog & yellow_bg(tklog &)
static const tkstring freset_font
Contains the style (color + type)
friend tklog & blink(tklog &)
friend tklog & bold(tklog &)
friend tklog & red_bg(tklog &)
friend tklog & error(tklog &)
friend tklog & do_header(tklog &)
Reimplementation of std::endl.
std::ostringstream fHeader
Contains the core message string to be printed with the current style.
friend tklog & warning_v(tklog &)
friend tklog & warning_vo(tklog &)
friend tklog & info_vo(tklog &)
void set_log_level(log_level _level)
std::string with usefull tricks from TString (ROOT) and KVString (KaliVeda) and more....
tklog & underline(tklog &log)
tklog & do_log(tklog &log)
tklog & blink(tklog &log)
tklog & error_o(tklog &log)
tklog & green_bg(tklog &log)
tklog & yellow_bg(tklog &log)
tklog & black_bg(tklog &log)
tklog & white(tklog &log)
tklog & yellow(tklog &log)
tklog & white_bg(tklog &log)
tklog & error_v(tklog &log)
tklog & regular(tklog &log)
Types.
tklog & warning_o(tklog &log)
tklog & info_vo(tklog &log)
tklog & info_o(tklog &log)
tklog & debug(tklog &log)
tklog & reset(tklog &log)
tklog & purple_bg(tklog &log)
tklog & skip_line(tklog &log)
Predefined macros.
tklog & warning_v(tklog &log)
tklog & do_header(tklog &log)
tklog & error_vo(tklog &log)
tklog & purple(tklog &log)
tklog & error(tklog &log)
tklog & blue_bg(tklog &log)
tklog & green(tklog &log)
tklog & info_v(tklog &log)
tklog & italic(tklog &log)
tklog & warning_vo(tklog &log)
tklog & black(tklog &log)
tklog & do_endl(tklog &log)
tklog & warning(tklog &log)
tklog & red_bg(tklog &log)
tklog & comment(tklog &log)
tklog & cyan_bg(tklog &log)
tklog & high_intensity(tklog &log)
Colors.