~ubuntu-branches/ubuntu/precise/crtmpserver/precise-backports

« back to all changes in this revision

Viewing changes to common/src/utils/logging/baseloglocation.cpp

  • Committer: Package Import Robot
  • Author(s): Micah Gersten
  • Date: 2012-07-04 00:04:40 UTC
  • mfrom: (3.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20120704000440-u9x7yhyglqjvspk8
Tags: 1.0~dfsg-3~ubuntu12.04.1
No-change backport to precise (LP: #964153)

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
        _level = -1;
25
25
        _name = "";
26
26
        _configuration = configuration;
 
27
        _specificLevel = 0;
 
28
        _singleLine = false;
27
29
}
28
30
 
29
31
BaseLogLocation::~BaseLogLocation() {
45
47
        _name = name;
46
48
}
47
49
 
48
 
 
 
50
bool BaseLogLocation::EvalLogLevel(int32_t level, string &fileName, uint32_t lineNumber,
 
51
                string &functionName, string &message) {
 
52
        return EvalLogLevel(level);
 
53
}
 
54
 
 
55
bool BaseLogLocation::EvalLogLevel(int32_t level, string fileName, uint32_t lineNumber,
 
56
                string functionName, Variant &le) {
 
57
        return EvalLogLevel(level);
 
58
}
 
59
 
 
60
bool BaseLogLocation::Init() {
 
61
        if (_configuration.HasKeyChain(_V_NUMERIC, false, 1,
 
62
                        CONF_LOG_APPENDER_SPECIFIC_LEVEL))
 
63
                _specificLevel = (int32_t) _configuration.GetValue(
 
64
                        CONF_LOG_APPENDER_SPECIFIC_LEVEL, false);
 
65
        if (_configuration.HasKeyChain(V_BOOL, false, 1, CONF_LOG_APPENDER_SINGLE_LINE))
 
66
                _singleLine = (bool)_configuration.GetValue(
 
67
                        CONF_LOG_APPENDER_SINGLE_LINE, false);
 
68
        return true;
 
69
}
 
70
 
 
71
bool BaseLogLocation::EvalLogLevel(int32_t level) {
 
72
        if (_specificLevel != 0) {
 
73
                if (_specificLevel != level)
 
74
                        return false;
 
75
                return true;
 
76
        } else {
 
77
                if (_level < 0 || level > _level)
 
78
                        return false;
 
79
                return true;
 
80
        }
 
81
}