add debugging to logging

This commit is contained in:
Isaac Connor 2018-02-14 11:56:54 -05:00
parent 4df8cdc685
commit 2e11c12d73
1 changed files with 7 additions and 1 deletions

View File

@ -402,10 +402,14 @@ void Logger::logFile( const std::string &logFile ) {
}
void Logger::openFile() {
if ( mLogFile.size() && (mLogFileFP = fopen( mLogFile.c_str() ,"a" )) == (FILE *)NULL ) {
if ( mLogFile.size() ) {
if ( (mLogFileFP = fopen(mLogFile.c_str() ,"a")) == (FILE *)NULL ) {
mFileLevel = NOLOG;
Fatal( "fopen() for %s, error = %s", mLogFile.c_str(), strerror(errno) );
}
} else {
puts("Called Logger::openFile() without a filename");
}
}
void Logger::closeFile() {
@ -524,6 +528,8 @@ void Logger::logPrint( bool hex, const char * const filepath, const int line, co
} else {
puts("Logging to file, but file not open\n");
}
} else {
puts("Not logging to file because level <= mFileLevel");
}
*syslogEnd = '\0';
if ( level <= mDatabaseLevel ) {