mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-26 02:18:04 +01:00
merge some changes from develop branch; modernize and clean-up code; remove support for compiling without POCO_WIN32_UTF8
This commit is contained in:
@@ -21,9 +21,9 @@
|
||||
#include "Poco/Foundation.h"
|
||||
#include "Poco/Formatter.h"
|
||||
#include "Poco/Message.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
||||
namespace Poco {
|
||||
|
||||
|
||||
@@ -77,6 +77,8 @@ class Foundation_API PatternFormatter: public Formatter
|
||||
|
||||
{
|
||||
public:
|
||||
using Ptr = AutoPtr<PatternFormatter>;
|
||||
|
||||
PatternFormatter();
|
||||
/// Creates a PatternFormatter.
|
||||
/// The format pattern must be specified with
|
||||
@@ -102,6 +104,8 @@ public:
|
||||
/// for details.
|
||||
/// * times: Specifies whether times are adjusted for local time
|
||||
/// or taken as they are in UTC. Supported values are "local" and "UTC".
|
||||
/// * priorityNames: Provide a comma-separated list of custom priority names,
|
||||
/// e.g. "Fatal, Critical, Error, Warning, Notice, Information, Debug, Trace"
|
||||
///
|
||||
/// If any other property name is given, a PropertyNotSupported
|
||||
/// exception is thrown.
|
||||
@@ -113,9 +117,10 @@ public:
|
||||
|
||||
static const std::string PROP_PATTERN;
|
||||
static const std::string PROP_TIMES;
|
||||
static const std::string PROP_PRIORITY_NAMES;
|
||||
|
||||
protected:
|
||||
static const std::string& getPriorityName(int);
|
||||
const std::string& getPriorityName(int);
|
||||
/// Returns a string for the given priority value.
|
||||
|
||||
private:
|
||||
@@ -134,11 +139,15 @@ private:
|
||||
void parsePattern();
|
||||
/// Will parse the _pattern string into the vector of PatternActions,
|
||||
/// which contains the message key, any text that needs to be written first
|
||||
/// a proprety in case of %[] and required length.
|
||||
/// a property in case of %[] and required length.
|
||||
|
||||
void parsePriorityNames();
|
||||
|
||||
std::vector<PatternAction> _patternActions;
|
||||
bool _localTime;
|
||||
std::string _pattern;
|
||||
std::string _priorityNames;
|
||||
std::string _priorities[9];
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user