(file) Return to TraceFileHandlerWindows.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/TraceFileHandlerWindows.cpp between version 1.22 and 1.27

version 1.22, 2008/12/19 10:17:10 version 1.27, 2013/05/03 04:49:10
Line 39 
Line 39 
  
 static Mutex writeMutex; static Mutex writeMutex;
  
 ////////////////////////////////////////////////////////////////////////////////  
 //   On other platforms prepares the file handle (open file etc.).  
 //   Implementation of this function is platform specific  
 //  
 //   Note: The current implementation on Windows does nothing.  
 //         Should be optimized out by the compiler  
 ////////////////////////////////////////////////////////////////////////////////  
 void TraceFileHandler::prepareFileHandle(void)  
 {  
     return;  
 }  
  
 //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
 //   Writes message to file. //   Writes message to file.
Line 61 
Line 50 
 //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
 void TraceFileHandler::handleMessage( void TraceFileHandler::handleMessage(
     const char* message,     const char* message,
     Uint32 msgLen,      Uint32,
     const char* fmt,     const char* fmt,
     va_list argList)     va_list argList)
 { {
     Uint32 retCode;     Uint32 retCode;
  
   
     if (_configHasChanged)     if (_configHasChanged)
     {     {
         _reConfigure();         _reConfigure();
     }     }
  
     if (_fileHandle)      if (!_fileHandle)
     {     {
           // The trace file is not open, which means an earlier fopen() was
           // unsuccessful.  Stop now to avoid logging duplicate error messages.
           return;
       }
   
         AutoMutex writeLock(writeMutex);         AutoMutex writeLock(writeMutex);
  
       if(!_fileExists(_fileName))
       {
           return;
       }
   
         //Move to the End of File         //Move to the End of File
         fseek(_fileHandle,0,SEEK_SET);         fseek(_fileHandle,0,SEEK_SET);
  
Line 101 
Line 101 
             // thus allow writing of errors to log again             // thus allow writing of errors to log again
             _logErrorBitField = 0;             _logErrorBitField = 0;
         }         }
     }  
     else  
     {  
         // Invalid file handle  
         // Log message  
         MessageLoaderParms parm(  
             "Common.TraceFileHandlerWindows.INVALID_FILE_HANDLE",  
             "Invalid file handle for file $0",  
             _fileName);  
         _logError(TRCFH_INVALID_FILE_HANDLE,parm);  
     }  
 } }
  
 //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
Line 122 
Line 112 
 //         Will have to be enhanced to support synchronous write operations to //         Will have to be enhanced to support synchronous write operations to
 //         the same file. //         the same file.
 //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
 void TraceFileHandler::handleMessage(const char* message, Uint32 msgLen)  void TraceFileHandler::handleMessage(const char* message, Uint32)
 { {
     Uint32 retCode;     Uint32 retCode;
  
Line 131 
Line 121 
         _reConfigure();         _reConfigure();
     }     }
  
     if (_fileHandle)      if (!_fileHandle)
     {     {
           // The trace file is not open, which means an earlier fopen() was
           // unsuccessful.  Stop now to avoid logging duplicate error messages.
           return;
       }
   
         AutoMutex writeLock(writeMutex);         AutoMutex writeLock(writeMutex);
  
       if(!_fileExists(_fileName))
       {
           return;
       }
   
         //Move to the End of File         //Move to the End of File
         fseek(_fileHandle,0,SEEK_SET);         fseek(_fileHandle,0,SEEK_SET);
  
Line 157 
Line 157 
             // thus allow writing of errors to log again             // thus allow writing of errors to log again
             _logErrorBitField = 0;             _logErrorBitField = 0;
         }         }
     }  
     else  
     {  
         // Invalid file handle  
         // Log message  
         MessageLoaderParms parm(  
             "Common.TraceFileHandlerWindows.INVALID_FILE_HANDLE",  
             "Invalid file handle for file $0",  
             _fileName);  
         _logError(TRCFH_INVALID_FILE_HANDLE,parm);  
     }  
 } }
  
  


Legend:
Removed from v.1.22  
changed lines
  Added in v.1.27

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2