8153731: Increase max tag combinations for UL expression (config)

Reviewed-by: stefank, mlarsson
This commit is contained in:
Robbin Ehn 2016-04-08 15:36:34 +02:00
parent cf254af2fb
commit e1a8c2d197
4 changed files with 19 additions and 2 deletions

View file

@ -32,6 +32,8 @@
#include "logging/log.hpp"
#include "logging/logConfiguration.hpp"
#include "logging/logOutput.hpp"
#include "logging/logTagLevelExpression.hpp"
#include "logging/logTagSet.hpp"
#include "logging/logStream.inline.hpp"
#include "memory/resourceArea.hpp"
@ -44,6 +46,13 @@
#define assert_char_not_in(c, s) \
assert(strchr(s, c) == NULL, "Expected '%s' to *not* contain character '%c'", s, c)
void Test_log_tag_combinations_limit() {
assert(LogTagLevelExpression::MaxCombinations > LogTagSet::ntagsets(),
"Combination limit (" SIZE_FORMAT ") not sufficient "
"for configuring all available tag sets (" SIZE_FORMAT ")",
LogTagLevelExpression::MaxCombinations, LogTagSet::ntagsets());
}
class TestLogFile {
private:
char file_name[256];

View file

@ -36,9 +36,12 @@ class LogTagSet;
// Class used to temporary encode a 'what'-expression during log configuration.
// Consists of a combination of tags and levels, e.g. "tag1+tag2=level1,tag3*=level2".
class LogTagLevelExpression : public StackObj {
friend void LogConfiguration::configure_stdout(LogLevelType, bool, ...);
public:
static const size_t MaxCombinations = 256;
private:
static const size_t MaxCombinations = 32;
friend void LogConfiguration::configure_stdout(LogLevelType, bool, ...);
static const char* DefaultExpressionString;
size_t _ntags, _ncombinations;

View file

@ -64,6 +64,10 @@ class LogTagSet VALUE_OBJ_CLASS_SPEC {
return _list;
}
static size_t ntagsets() {
return _ntagsets;
}
LogTagSet* next() {
return _next;
}

View file

@ -67,6 +67,7 @@ void InternalVMTests::run() {
run_unit_test(Test_linked_list);
run_unit_test(TestChunkedList_test);
run_unit_test(JSON_test);
run_unit_test(Test_log_tag_combinations_limit);
run_unit_test(Test_logtarget);
run_unit_test(Test_logstream);
run_unit_test(Test_loghandle);