From 2e11c12d735b37602394b30b9c6b4c8f50f89b84 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 14 Feb 2018 11:56:54 -0500 Subject: [PATCH] add debugging to logging --- src/zm_logger.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/zm_logger.cpp b/src/zm_logger.cpp index 9c8efd456..e8102aafa 100644 --- a/src/zm_logger.cpp +++ b/src/zm_logger.cpp @@ -402,9 +402,13 @@ 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"); } } @@ -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 ) {