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

Diff for /pegasus/src/Pegasus/Common/Tracer.h between version 1.17 and 1.21

version 1.17, 2005/01/19 23:48:05 version 1.21, 2005/11/18 21:19:11
Line 1 
Line 1 
 //%2004////////////////////////////////////////////////////////////////////////  //%2005////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
Line 6 
Line 6 
 // IBM Corp.; EMC Corporation, The Open Group. // IBM Corp.; EMC Corporation, The Open Group.
 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
   // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
   // EMC Corporation; VERITAS Software Corporation; The Open Group.
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to // of this software and associated documentation files (the "Software"), to
Line 37 
Line 39 
 #define Pegasus_Tracer_h #define Pegasus_Tracer_h
  
 #include <stdarg.h> #include <stdarg.h>
 #include <fstream>  
 #include <Pegasus/Common/String.h> #include <Pegasus/Common/String.h>
 #include <Pegasus/Common/System.h> #include <Pegasus/Common/System.h>
 #include <Pegasus/Common/Logger.h> #include <Pegasus/Common/Logger.h>
Line 163 
Line 164 
             const char*  data,             const char*  data,
             const Uint32 size)             const Uint32 size)
         {         {
               if (_traceOn)
               {
             _traceBuffer( traceComponent, traceLevel, data, size );             _traceBuffer( traceComponent, traceLevel, data, size );
         }         }
           }
  
         /** Traces the specified number of bytes in a given buffer         /** Traces the specified number of bytes in a given buffer
             Overloaded to include the filename and the line number             Overloaded to include the filename and the line number
Line 184 
Line 188 
             const char*  data,             const char*  data,
             const Uint32 size)             const Uint32 size)
         {         {
               if (_traceOn)
               {
             _traceBuffer( fileName, lineNum,             _traceBuffer( fileName, lineNum,
                           traceComponent, traceLevel, data, size );                           traceComponent, traceLevel, data, size );
         }         }
           }
  
  
         /** Traces the given message         /** Traces the given message
Line 201 
Line 208 
             const char *fmt,             const char *fmt,
             ...)             ...)
         {         {
               if (_traceOn)
               {
             va_list argList;             va_list argList;
  
             va_start(argList,fmt);             va_start(argList,fmt);
             _trace(traceComponent,traceLevel,fmt,argList);             _trace(traceComponent,traceLevel,fmt,argList);
             va_end(argList);             va_end(argList);
         }         }
           }
  
         /** Traces the given message. Overloaded to include the filename and         /** Traces the given message. Overloaded to include the filename and
             the line number of trace origin.             the line number of trace origin.
Line 225 
Line 235 
             const char* fmt,             const char* fmt,
             ...)             ...)
         {         {
               if (_traceOn)
               {
             va_list argList;             va_list argList;
  
             va_start(argList,fmt);             va_start(argList,fmt);
             _trace(fileName,lineNum,traceComponent,traceLevel,fmt,argList);             _trace(fileName,lineNum,traceComponent,traceLevel,fmt,argList);
             va_end(argList);             va_end(argList);
         }         }
           }
  
         /** Traces the given string.  Overloaded to include the filename         /** Traces the given string.  Overloaded to include the filename
             and line number of trace origin.             and line number of trace origin.
Line 247 
Line 260 
             const Uint32  traceLevel,             const Uint32  traceLevel,
             const String& traceString)             const String& traceString)
         {         {
               if (_traceOn)
               {
             _traceString( fileName, lineNum, traceComponent, traceLevel,             _traceString( fileName, lineNum, traceComponent, traceLevel,
                           traceString );                           traceString );
         }         }
           }
  
         /** Traces the message in the given CIMException object.  The message         /** Traces the message in the given CIMException object.  The message
             written to the trace file will include the source filename and             written to the trace file will include the source filename and
Line 263 
Line 279 
             const Uint32  traceLevel,             const Uint32  traceLevel,
             CIMException  cimException)             CIMException  cimException)
         {         {
               if (_traceOn)
               {
             _traceCIMException( traceComponent, traceLevel, cimException );             _traceCIMException( traceComponent, traceLevel, cimException );
         }         }
           }
  
         /** Set the trace file to the given file         /** Set the trace file to the given file
             @param    traceFile       full path of the trace file             @param    traceFile       full path of the trace file
Line 305 
Line 324 
         const Uint32 traceComponent,         const Uint32 traceComponent,
         const char* methodName)         const char* methodName)
     {     {
           if (_traceOn)
           {
         _traceEnter( fileName, lineNum, traceComponent, "%s %s",         _traceEnter( fileName, lineNum, traceComponent, "%s %s",
             _METHOD_ENTER_MSG, methodName);             _METHOD_ENTER_MSG, methodName);
     }     }
       }
  
     /** Traces method exit.     /** Traces method exit.
         @param    fileName        filename of the trace originator         @param    fileName        filename of the trace originator
Line 321 
Line 343 
         const Uint32 traceComponent,         const Uint32 traceComponent,
         const char* methodName)         const char* methodName)
     {     {
           if (_traceOn)
           {
         _traceExit( fileName, lineNum, traceComponent, "%s %s",         _traceExit( fileName, lineNum, traceComponent, "%s %s",
             _METHOD_EXIT_MSG, methodName);             _METHOD_EXIT_MSG, methodName);
     }     }
       }
  
     /** Validates the File Path for the trace File     /** Validates the File Path for the trace File
         @param    filePath full path of the file         @param    filePath full path of the file
Line 355 
Line 380 
      */      */
     static void setModuleName(const String& moduleName);     static void setModuleName(const String& moduleName);
  
       static bool isTraceOn() { return _traceOn; }
   
 private: private:
  
       /** A static single indicator if tracing is turned on allowing to
           determine the state of trace quickly without many instructions.
           Used to wrap the public static trace interface methods to avoid
           obsolete calls when tracing is turned off.
        */
       static Uint32 _traceOn;
   
     static const char   _COMPONENT_SEPARATOR;     static const char   _COMPONENT_SEPARATOR;
     static const Uint32 _NUM_COMPONENTS;     static const Uint32 _NUM_COMPONENTS;
     static const Uint32 _STRLEN_MAX_UNSIGNED_INT;     static const Uint32 _STRLEN_MAX_UNSIGNED_INT;
Line 553 
Line 587 
         @param    traceString     the string to be traced         @param    traceString     the string to be traced
      */      */
     #define PEG_TRACE_STRING(traceComponent,traceLevel,traceString) \     #define PEG_TRACE_STRING(traceComponent,traceLevel,traceString) \
         Tracer::trace(__FILE__, __LINE__,traceComponent,traceLevel,traceString)          do \
           { \
               if (Tracer::isTraceOn()) \
                   Tracer::trace( \
                       __FILE__, __LINE__,traceComponent,traceLevel,traceString); \
           } \
           while (0)
  
 #endif #endif
  


Legend:
Removed from v.1.17  
changed lines
  Added in v.1.21

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2