text
stringlengths
0
2.2M
ofLogNotice::ofLogNotice(const string & module, const char* format, ...){
if(checkLog(OF_LOG_NOTICE, module)){
va_list args;
va_start(args, format);
channel()->log(OF_LOG_NOTICE, module, format, args);
va_end(args);
}
bPrinted = true;
}
//--------------------------------------------------
ofLogWarning::ofLogWarning(const string & _module){
level = OF_LOG_WARNING;
module = _module;
bPrinted=false;
}
ofLogWarning::ofLogWarning(const string & _module, const string & _message){
_log(OF_LOG_WARNING,_module,_message);
bPrinted = true;
}
ofLogWarning::ofLogWarning(const string & module, const char* format, ...){
if(checkLog(OF_LOG_WARNING, module)){
va_list args;
va_start(args, format);
channel()->log(OF_LOG_WARNING, module, format, args);
va_end(args);
}
bPrinted = true;
}
//--------------------------------------------------
ofLogError::ofLogError(const string & _module){
level = OF_LOG_ERROR;
module = _module;
bPrinted=false;
}
ofLogError::ofLogError(const string & _module, const string & _message){
_log(OF_LOG_ERROR,_module,_message);
bPrinted = true;
}
ofLogError::ofLogError(const string & module, const char* format, ...){
if(checkLog(OF_LOG_ERROR, module)){
va_list args;
va_start(args, format);
channel()->log(OF_LOG_ERROR, module, format, args);
va_end(args);
}
bPrinted = true;
}
//--------------------------------------------------
ofLogFatalError::ofLogFatalError(const string & _module){
level = OF_LOG_FATAL_ERROR;
module = _module;
bPrinted=false;
}
ofLogFatalError::ofLogFatalError(const string & _module, const string & _message){
_log(OF_LOG_FATAL_ERROR,_module,_message);
bPrinted = true;
}
ofLogFatalError::ofLogFatalError(const string & module, const char* format, ...){
if(checkLog(OF_LOG_FATAL_ERROR, module)){
va_list args;
va_start(args, format);
channel()->log(OF_LOG_FATAL_ERROR, module, format, args);
va_end(args);
}
bPrinted = true;
}
//--------------------------------------------------
void ofLog::setChannel(shared_ptr<ofBaseLoggerChannel> _channel){
channel() = _channel;
}
void ofSetLoggerChannel(shared_ptr<ofBaseLoggerChannel> loggerChannel){
ofLog::setChannel(loggerChannel);
}
shared_ptr<ofBaseLoggerChannel> ofLog::getChannel(){
return channel();
}
shared_ptr<ofBaseLoggerChannel> ofGetLoggerChannel(){
return ofLog::getChannel();
}
string ofGetLogLevelName(ofLogLevel level, bool pad){
switch(level){
case OF_LOG_VERBOSE:
return "verbose";
case OF_LOG_NOTICE:
return pad ? "notice " : "notice";
case OF_LOG_WARNING: