4#include "../clutchlog/clutchlog.h"
21 log.threshold(clutchlog::level::info);
24 log.style(clutchlog::level::critical, error);
27 CLUTCHLOG(info,
"Either using functions...");
28 std::cout << none(
"No style: ") << std::endl;
29 std::cout << note(
"NOTE: bold") << std::endl;
30 std::cout << info(
"INFO: green") << std::endl;
33 std::cout << warning <<
"WARNING" << end <<
": bold magenta" << std::endl;
34 std::cout << error <<
"ERROR" << end <<
": bold red" << std::endl;
35 std::cout << critical <<
"CRITICAL" << end <<
": underlined black over red background" << std::endl;
37 std::ostringstream format;
40 << discreet(
"{file}:")
42 <<
clutchlog::fmt(clutchlog::fmt::typo::reset) <<
" {msg} ! " << std::endl;
43 log.format(format.str());
44 CLUTCHLOG(critical,
"After having inserted styles within a new format template");
Color and style formatter for ANSI terminal escape sequences.
typo
Typographic style codes.
static clutchlog & logger()
Get the logger instance.
#define CLUTCHLOG(LEVEL, WHAT)
Log a message at the given level.
bg
Background color codes.
fg
Foreground color codes.