Change naming convention of class properties
This commit is contained in:
1 parent
f45201aa45
commit
eb8bc7a696
14 files changed
+71
-71
No files matched your search
+23
-23
@@ -58,86 +58,86 @@ void Logger::log(Level lvl, const char* msg) {
|
||||
}
|
||||
|
||||
Logger::Sink::Sink (const Level level, Logger& parent) :
|
||||
level_(level),
|
||||
parent_(parent),
|
||||
lineIsPrefixed_(false) {}
|
||||
_level(level),
|
||||
_parent(parent),
|
||||
_lineIsPrefixed(false) {}
|
||||
|
||||
void Logger::Sink::ln ( const string& msg ) {
|
||||
ln(msg.c_str());
|
||||
}
|
||||
|
||||
void Logger::Sink::ln ( const char* msg ) {
|
||||
if ( level_ >= parent_.logLevel ) {
|
||||
if ( _level>= _parent.logLevel ) {
|
||||
// If line has already been started, abort it and start new one:
|
||||
if(lineIsPrefixed_) *parent_.output << endl;
|
||||
if(_lineIsPrefixed) *_parent.output << endl;
|
||||
prefixLine(true);
|
||||
*parent_.output << msg << endl;
|
||||
*_parent.output << msg << endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Logger::Sink::prefixLine(bool resetToFalse) {
|
||||
if (!lineIsPrefixed_) {
|
||||
if (!_lineIsPrefixed) {
|
||||
const char* lvlString;
|
||||
switch ( level_ )
|
||||
switch ( _level)
|
||||
{
|
||||
case DEBUG: lvlString = "DEBUG"; break;
|
||||
case INFO: lvlString = "INFO"; break;
|
||||
case WARN: lvlString = "WARN"; break;
|
||||
case FATAL: lvlString = "FATAL"; break;
|
||||
}
|
||||
*parent_.output << Logger::genTimeStamp() << " [" << lvlString << "] ";
|
||||
lineIsPrefixed_ = resetToFalse ? false : true;
|
||||
*_parent.output << Logger::genTimeStamp() << " [" << lvlString << "] ";
|
||||
_lineIsPrefixed = resetToFalse ? false : true;
|
||||
}
|
||||
}
|
||||
|
||||
Logger::Sink& Logger::Sink::operator<<(const string& msg) {
|
||||
if ( level_ >= parent_.logLevel ) {
|
||||
if ( _level>= _parent.logLevel ) {
|
||||
prefixLine();
|
||||
*parent_.output << msg;
|
||||
*_parent.output << msg;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
Logger::Sink& Logger::Sink::operator<<(const char* msg) {
|
||||
if ( level_ >= parent_.logLevel ) {
|
||||
if ( _level>= _parent.logLevel ) {
|
||||
prefixLine();
|
||||
*parent_.output << msg;
|
||||
*_parent.output << msg;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Logger::Sink& Logger::Sink::operator<<(const int msg) {
|
||||
if ( level_ >= parent_.logLevel ) {
|
||||
if ( _level>= _parent.logLevel ) {
|
||||
prefixLine();
|
||||
*parent_.output << msg;
|
||||
*_parent.output << msg;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
Logger::Sink& Logger::Sink::operator<<(const long msg) {
|
||||
if ( level_ >= parent_.logLevel ) {
|
||||
if ( _level>= _parent.logLevel ) {
|
||||
prefixLine();
|
||||
*parent_.output << msg;
|
||||
*_parent.output << msg;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
Logger::Sink& Logger::Sink::operator<<(const unsigned long msg) {
|
||||
if ( level_ >= parent_.logLevel ) {
|
||||
if ( _level>= _parent.logLevel ) {
|
||||
prefixLine();
|
||||
*parent_.output << msg;
|
||||
*_parent.output << msg;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
Logger::Sink& Logger::Sink::operator<<(const char character) {
|
||||
if ( level_ >= parent_.logLevel ) {
|
||||
if ( _level>= _parent.logLevel ) {
|
||||
switch(character) {
|
||||
// COMMIT - End message line
|
||||
case 0:
|
||||
*parent_.output << endl;
|
||||
lineIsPrefixed_ = false;
|
||||
*_parent.output << endl;
|
||||
_lineIsPrefixed = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user