mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-16 11:48:54 +01:00
fixes for style and consistency
This commit is contained in:
parent
74ffb112bc
commit
fafe691a04
@ -23,9 +23,9 @@
|
||||
#include "Poco/Foundation.h"
|
||||
#include "Poco/Formatter.h"
|
||||
#include "Poco/Message.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
||||
namespace Poco {
|
||||
|
||||
|
||||
@ -105,6 +105,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.
|
||||
@ -145,8 +147,8 @@ private:
|
||||
std::vector<PatternAction> _patternActions;
|
||||
bool _localTime;
|
||||
std::string _pattern;
|
||||
std::string _priorityNames;
|
||||
std::string _priorities[9];
|
||||
std::string _priorityNames;
|
||||
std::string _priorities[9];
|
||||
};
|
||||
|
||||
|
||||
|
@ -249,15 +249,22 @@ namespace
|
||||
};
|
||||
}
|
||||
|
||||
void PatternFormatter::parsePriorityNames()
|
||||
|
||||
void PatternFormatter::parsePriorityNames()
|
||||
{
|
||||
for (int i = 0; i <= 8; i++)
|
||||
{
|
||||
for (int i = 0; i <= 8; i++)
|
||||
_priorities[i] = priorities[i];
|
||||
StringTokenizer st (_priorityNames, ".", StringTokenizer::TOK_TRIM);
|
||||
if (st.count() == 8)
|
||||
for (int i = 1; i <= 8; i++)
|
||||
_priorities[i] = st[i-1];
|
||||
_priorities[i] = priorities[i];
|
||||
}
|
||||
StringTokenizer st(_priorityNames, ",;", StringTokenizer::TOK_TRIM);
|
||||
if (st.count() == 8)
|
||||
{
|
||||
for (int i = 1; i <= 8; i++)
|
||||
_priorities[i] = st[i - 1];
|
||||
}
|
||||
else throw Poco::SyntaxException("priorityNames property must specify a comma-separated list of 8 property names");
|
||||
}
|
||||
|
||||
|
||||
const std::string& PatternFormatter::getPriorityName(int prio)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user