style fix

This commit is contained in:
Günter Obiltschnig 2020-02-13 22:08:44 +01:00
parent 23da8c21c9
commit dea91c8105

View File

@ -73,7 +73,7 @@ class Foundation_API Logger: public Channel
/// are used. The macros also add the source file path and line
/// number into the log message so that it is available to formatters.
/// Variants of these macros that allow message formatting with Poco::format()
/// are also available.
/// are also available.
///
/// Examples:
/// poco_warning(logger, "This is a warning");
@ -88,20 +88,20 @@ public:
void setChannel(Channel::Ptr pChannel);
/// Attaches the given Channel to the Logger.
Channel::Ptr getChannel() const;
/// Returns the Channel attached to the logger.
void setLevel(int level);
/// Sets the Logger's log level.
///
/// See Message::Priority for valid log levels.
/// Setting the log level to zero turns off
/// logging for that Logger.
int getLevel() const;
/// Returns the Logger's log level.
void setLevel(const std::string& level);
/// Sets the Logger's log level using a symbolic value.
///
@ -126,17 +126,17 @@ public:
void log(const Message& msg);
/// Logs the given message if its priority is
/// greater than or equal to the Logger's log level.
void log(const Exception& exc);
/// Logs the given exception with priority PRIO_ERROR.
/// Logs the given exception with priority PRIO_ERROR.
void log(const Exception& exc, const char* file, int line);
/// Logs the given exception with priority PRIO_ERROR.
/// Logs the given exception with priority PRIO_ERROR.
///
/// File must be a static string, such as the value of
/// the __FILE__ macro. The string is not copied
/// internally for performance reasons.
/// internally for performance reasons.
void fatal(const std::string& msg);
/// If the Logger's log level is at least PRIO_FATAL,
/// creates a Message with priority PRIO_FATAL
@ -151,10 +151,10 @@ public:
///
/// File must be a static string, such as the value of
/// the __FILE__ macro. The string is not copied
/// internally for performance reasons.
/// internally for performance reasons.
template <typename T, typename... Args>
void fatal(const std::string &fmt, T arg1, Args&&... args)
void fatal(const std::string& fmt, T arg1, Args&&... args)
{
log(Poco::format(fmt, arg1, std::forward<Args>(args)...), Message::PRIO_FATAL);
}
@ -173,10 +173,10 @@ public:
///
/// File must be a static string, such as the value of
/// the __FILE__ macro. The string is not copied
/// internally for performance reasons.
/// internally for performance reasons.
template <typename T, typename... Args>
void critical(const std::string &fmt, T arg1, Args&&... args)
void critical(const std::string& fmt, T arg1, Args&&... args)
{
log(Poco::format(fmt, arg1, std::forward<Args>(args)...), Message::PRIO_CRITICAL);
}
@ -195,10 +195,10 @@ public:
///
/// File must be a static string, such as the value of
/// the __FILE__ macro. The string is not copied
/// internally for performance reasons.
/// internally for performance reasons.
template <typename T, typename... Args>
void error(const std::string &fmt, T arg1, Args&&... args)
void error(const std::string& fmt, T arg1, Args&&... args)
{
log(Poco::format(fmt, arg1, std::forward<Args>(args)...), Message::PRIO_ERROR);
}
@ -217,10 +217,10 @@ public:
///
/// File must be a static string, such as the value of
/// the __FILE__ macro. The string is not copied
/// internally for performance reasons.
/// internally for performance reasons.
template <typename T, typename... Args>
void warning(const std::string &fmt, T arg1, Args&&... args)
void warning(const std::string& fmt, T arg1, Args&&... args)
{
log(Poco::format(fmt, arg1, std::forward<Args>(args)...), Message::PRIO_WARNING);
}
@ -239,10 +239,10 @@ public:
///
/// File must be a static string, such as the value of
/// the __FILE__ macro. The string is not copied
/// internally for performance reasons.
/// internally for performance reasons.
template <typename T, typename... Args>
void notice(const std::string &fmt, T arg1, Args&&... args)
void notice(const std::string& fmt, T arg1, Args&&... args)
{
log(Poco::format(fmt, arg1, std::forward<Args>(args)...), Message::PRIO_NOTICE);
}
@ -261,10 +261,10 @@ public:
///
/// File must be a static string, such as the value of
/// the __FILE__ macro. The string is not copied
/// internally for performance reasons.
/// internally for performance reasons.
template <typename T, typename... Args>
void information(const std::string &fmt, T arg1, Args&&... args)
void information(const std::string& fmt, T arg1, Args&&... args)
{
log(Poco::format(fmt, arg1, std::forward<Args>(args)...), Message::PRIO_INFORMATION);
}
@ -283,10 +283,10 @@ public:
///
/// File must be a static string, such as the value of
/// the __FILE__ macro. The string is not copied
/// internally for performance reasons.
/// internally for performance reasons.
template <typename T, typename... Args>
void debug(const std::string &fmt, T arg1, Args&&... args)
void debug(const std::string& fmt, T arg1, Args&&... args)
{
log(Poco::format(fmt, arg1, std::forward<Args>(args)...), Message::PRIO_DEBUG);
}
@ -305,10 +305,10 @@ public:
///
/// File must be a static string, such as the value of
/// the __FILE__ macro. The string is not copied
/// internally for performance reasons.
/// internally for performance reasons.
template <typename T, typename... Args>
void trace(const std::string &fmt, T arg1, Args&&... args)
void trace(const std::string& fmt, T arg1, Args&&... args)
{
log(Poco::format(fmt, arg1, std::forward<Args>(args)...), Message::PRIO_TRACE);
}
@ -317,17 +317,17 @@ public:
/// Logs the given message, followed by the data in buffer.
///
/// The data in buffer is written in canonical hex+ASCII form:
/// Offset (4 bytes) in hexadecimal, followed by sixteen
/// Offset (4 bytes) in hexadecimal, followed by sixteen
/// space-separated, two column, hexadecimal bytes,
/// followed by the same sixteen bytes as ASCII characters.
/// For bytes outside the range 32 .. 127, a dot is printed.
bool is(int level) const;
/// Returns true if at least the given log level is set.
bool fatal() const;
/// Returns true if the log level is at least PRIO_FATAL.
bool critical() const;
/// Returns true if the log level is at least PRIO_CRITICAL.
@ -353,18 +353,18 @@ public:
/// Replaces all occurrences of $0 in fmt with the string given in arg and
/// returns the result. To include a dollar sign in the result string,
/// specify two dollar signs ($$) in the format string.
static std::string format(const std::string& fmt, const std::string& arg0, const std::string& arg1);
/// Replaces all occurrences of $<n> in fmt with the string given in arg<n> and
/// returns the result. To include a dollar sign in the result string,
/// specify two dollar signs ($$) in the format string.
static std::string format(const std::string& fmt, const std::string& arg0, const std::string& arg1, const std::string& arg2);
static std::string format(const std::string& fmt, const std::string& arg0, const std::string& arg1, const std::string& arg2);
/// Replaces all occurrences of $<n> in fmt with the string given in arg<n> and
/// returns the result. To include a dollar sign in the result string,
/// specify two dollar signs ($$) in the format string.
static std::string format(const std::string& fmt, const std::string& arg0, const std::string& arg1, const std::string& arg2, const std::string& arg3);
static std::string format(const std::string& fmt, const std::string& arg0, const std::string& arg1, const std::string& arg2, const std::string& arg3);
/// Replaces all occurrences of $<n> in fmt with the string given in arg<n> and
/// returns the result. To include a dollar sign in the result string,
/// specify two dollar signs ($$) in the format string.
@ -372,11 +372,11 @@ public:
static void formatDump(std::string& message, const void* buffer, std::size_t length);
/// Creates a hex-dump of the given buffer and appends it to the
/// given message string.
static void setLevel(const std::string& name, int level);
/// Sets the given log level on all loggers that are
/// descendants of the Logger with the given name.
static void setChannel(const std::string& name, Channel::Ptr pChannel);
/// Attaches the given Channel to all loggers that are
/// descendants of the Logger with the given name.
@ -399,35 +399,35 @@ public:
/// probably use get() instead.
/// The only time this method should be used is during
/// program initialization, when only one thread is running.
static Logger& create(const std::string& name, Channel::Ptr pChannel, int level = Message::PRIO_INFORMATION);
/// Creates and returns a reference to a Logger with the
/// given name. The Logger's Channel and log level as set as
/// specified.
static Logger& root();
/// Returns a reference to the root logger, which is the ultimate
/// ancestor of all Loggers.
static Ptr has(const std::string& name);
/// Returns a pointer to the Logger with the given name if it
/// exists, or a null pointer otherwise.
static void destroy(const std::string& name);
/// Destroys the logger with the specified name. Does nothing
/// if the logger is not found.
///
/// After a logger has been destroyed, all references to it
/// become invalid.
/// become invalid.
static void shutdown();
/// Shuts down the logging framework and releases all
/// Loggers.
static void names(std::vector<std::string>& names);
/// Fills the given vector with the names
/// of all currently defined loggers.
static int parseLevel(const std::string& level);
/// Parses a symbolic log level from a string and
/// returns the resulting numeric level.
@ -444,15 +444,15 @@ public:
/// - trace
///
/// The level is not case sensitive.
static const std::string ROOT; /// The name of the root logger ("").
static const std::string ROOT; /// The name of the root logger ("").
protected:
typedef std::map<std::string, Ptr> LoggerMap;
Logger(const std::string& name, Channel::Ptr pChannel, int level);
~Logger();
void log(const std::string& text, Message::Priority prio);
void log(const std::string& text, Message::Priority prio, const char* file, int line);
@ -467,7 +467,7 @@ private:
Logger();
Logger(const Logger&);
Logger& operator = (const Logger&);
std::string _name;
Channel::Ptr _pChannel;
int _level;