42#define CLAW_MK_STR_(e) #e
48#define CLAW_MK_STR(e) CLAW_MK_STR_(e)
61 setlocale(LC_ALL,
"");
62#ifdef CLAW_TEXT_DOMAIN_PATH
63 bindtextdomain(
"libclaw",
CLAW_MK_STR(CLAW_TEXT_DOMAIN_PATH));
65 bind_textdomain_codeset(
"libclaw",
"UTF-8");
66 textdomain(
"libclaw");
69 "--log-file",
claw_gettext(
"The file to use to store log informations."),
74 "\t\terror: error messages,\n"
75 "\t\twarning: warning and error messages,\n"
76 "\t\tverbose: all messages."),
81 "Use a logger that does not output successively the same message."),
86 "Use a logger that does not output messages that have been recently"
102 &&
m_arguments.only_integer_values(
"--log-concise")
113 std::string level =
m_arguments.get_string(
"--log-level");
115 if((level ==
"error") || (level ==
claw_gettext(
"error")))
117 else if((level ==
"warning") || (level ==
claw_gettext(
"warning")))
119 else if((level ==
"verbose") || (level ==
claw_gettext(
"verbose")))
#define CLAW_MK_STR(e)
Build a char[] string representing an expression.
A class to represent the application.
application(int &argc, char **&argv)
Constructor.
arguments_table m_arguments
The arguments passed by the system.
virtual ~application()
Destructor.
This class write log messages in std::clog.
This class write log messages in a file.
A log stream that does not output a message that have been recently output.
A log stream that does not output successively the same message.
Base class for streams accepting log output.
Macros to call gettext on the libclaw textdomain.
#define claw_gettext(s)
Call gettext on the default text domain used by Claw.
A log stream that does not output a message that have been recently output.
A log stream that does not output successively the same message.
Some basic classes for logging.
CLAW_LOGGER_EXPORT log_level log_error
Use this level if something goes really bad and your application may crash.
CLAW_LOGGER_EXPORT log_level log_warning
Use this level if a small problem occurs and you can deal with it without crashing the application.
CLAW_LOGGER_EXPORT log_system logger
The default log system provided by claw.
CLAW_LOGGER_EXPORT log_level log_verbose
Use this level if you want to inform the user about a situation that is not problematic.