5#ifndef GEMMI_LOGGER_HPP_
6#define GEMMI_LOGGER_HPP_
62 std::fprintf(
stderr,
"%s\n", s.c_str());
66 std::fprintf(
stdout,
"%s\n", s.c_str());
fail(), unreachable() and __declspec/__attribute__ macros
std::string cat(Args const &... args)
void fail(const std::string &msg)
Passes messages (including warnings/errors) to a callback function.
static void to_stderr(const std::string &s)
to be used as: logger.callback = Logger::to_stderr;
void mesg(Args const &... args) const
Send a message without any prefix.
void suspend()
suspend() and resume() are used internally to avoid duplicate messages when the same function is call...
GEMMI_COLD void err(Args const &... args) const
Send a warning/error (see Quirk above).
static void to_stdout(const std::string &s)
to be used as: logger.callback = Logger::to_stdout;
void debug(Args const &... args) const
Send a debug message.
void level(Args const &... args) const
Send a message without any prefix on with a numeric threshold N.
int threshold
Pass messages of this level and all lower (more severe) levels: 8=all, 6=all but debug,...
void note(Args const &... args) const
Send a note (a notice, a significant message).
std::function< void(const std::string &)> callback
A function that handles messages.
Utilities. Mostly for working with strings and vectors.