51thread_local tklog *tklog::g_log =
nullptr;
57 if ( g_log ==
nullptr ) {
66 if(_value>_max)
return;
72 std::cout <<
"\e[94;108;1m" <<
"[";
73 int pos = (int) (barWidth * (1.*_value/_max));
74 for (
int i = 0; i < barWidth; ++i) {
75 if (i < pos) std::cout <<
"=";
76 else if (i == pos) std::cout <<
"=";
77 else std::cout <<
" ";
79 std::cout <<
"] " <<
freset_font << _message <<
" \r";
82 if(_value==_max) std::cout << std::endl;
87void tklog::set_type(bType _type)
101void tklog::process_color()
105 tkstring fg_color, bg_color;
Classe used to print debugs, infos, warnings and errors into the terminal.
void progress_bar(int _max, int _value, const tkstring &_message="")
friend tklog & reset(tklog &)
To print the current message, then reset the log.
bool fHigh_intensity_colors
static tklog * the_log()
glog is a singleton used for fancy prints in the terminal
static const tkstring freset_font
Contains the style (color + type)
std::ostringstream fHeader
Contains the core message string to be printed with the current style.
std::string with usefull tricks from TString (ROOT) and KVString (KaliVeda) and more....
static tkstring Form(const char *_format,...)
tkstring & append(const tkstring &_st)