fixes for style and consistency

This commit is contained in:
Guenter Obiltschnig
2015-08-20 14:55:17 +02:00
parent 74ffb112bc
commit fafe691a04
2 changed files with 19 additions and 10 deletions

View File

@@ -23,9 +23,9 @@
#include "Poco/Foundation.h" #include "Poco/Foundation.h"
#include "Poco/Formatter.h" #include "Poco/Formatter.h"
#include "Poco/Message.h" #include "Poco/Message.h"
#include <vector> #include <vector>
namespace Poco { namespace Poco {
@@ -105,6 +105,8 @@ public:
/// for details. /// for details.
/// * times: Specifies whether times are adjusted for local time /// * times: Specifies whether times are adjusted for local time
/// or taken as they are in UTC. Supported values are "local" and "UTC". /// 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 /// If any other property name is given, a PropertyNotSupported
/// exception is thrown. /// exception is thrown.

View File

@@ -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]; _priorities[i] = priorities[i];
StringTokenizer st (_priorityNames, ".", StringTokenizer::TOK_TRIM); }
StringTokenizer st(_priorityNames, ",;", StringTokenizer::TOK_TRIM);
if (st.count() == 8) if (st.count() == 8)
{
for (int i = 1; i <= 8; i++) for (int i = 1; i <= 8; i++)
_priorities[i] = st[i - 1]; _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) const std::string& PatternFormatter::getPriorityName(int prio)
{ {