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

  1 mike  1.8 //%/////////////////////////////////////////////////////////////////////////////
  2           //
  3 kumpf 1.10 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
  4            // The Open Group, Tivoli Systems
  5 mike  1.8  //
  6            // Permission is hereby granted, free of charge, to any person obtaining a copy
  7 kumpf 1.10 // of this software and associated documentation files (the "Software"), to
  8            // deal in the Software without restriction, including without limitation the
  9            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 10 mike  1.8  // sell copies of the Software, and to permit persons to whom the Software is
 11            // furnished to do so, subject to the following conditions:
 12            // 
 13 kumpf 1.10 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 14 mike  1.8  // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 15            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 16 kumpf 1.10 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 17            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 18            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 19 mike  1.8  // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 20            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 21            //
 22            //==============================================================================
 23            //
 24            // Author: Mike Brasher (mbrasher@bmc.com)
 25            //
 26            // Modified By:
 27            //
 28            //%/////////////////////////////////////////////////////////////////////////////
 29            
 30            #ifndef Pegasus_Logger_h
 31            #define Pegasus_Logger_h
 32            
 33            #include <Pegasus/Common/Config.h>
 34            #include <Pegasus/Common/Formatter.h>
 35 kumpf 1.11 #include <Pegasus/Common/Linkage.h>
 36 mike  1.8  
 37            PEGASUS_NAMESPACE_BEGIN
 38            
 39            class LoggerRep;
 40            
 41 mike  1.9  // REVIEW: is this still used? Are there other mechanisms?
 42            
 43 mike  1.8  /**
 44            
 45            */
 46            class PEGASUS_COMMON_LINKAGE Logger
 47            {
 48            public:
 49            
 50                enum LogFileType 
 51                { 
 52            	TRACE_LOG, 
 53            	STANDARD_LOG, 
 54            	ERROR_LOG,
 55            	DEBUG_LOG
 56                };
 57                enum { NUM_LOGS = 4 };
 58                  
 59                /** Log file Level - Defines the level of severity of the
 60                    log entry irrespective of which log file it goes into. This is 
 61                    actually a bit mask as defined in logger.cpp.  Thus, it serves both
 62                    as a level of indication of the seriousness and possibly as a mask
 63                    to select what is logged.
 64 mike  1.8          ATTN: The selection test has not been done.
 65                */
 66            
 67                static const Uint32 TRACE;
 68                static const Uint32 INFORMATION;
 69                static const Uint32 WARNING;
 70                static const Uint32 SEVERE;
 71                static const Uint32 FATAL;
 72            
 73                /** put - Puts a message to the defined log file
 74            	@param logFileType - Type of log file (Trace, etc.)
 75            	@param systemId  - ID of the system generating the log entry within 
 76            	Pegasus. This is user defined but generally breaks down into major
 77            	Pegasus components.
 78            	@param level Level of severity of the log entry. To be used both t0
 79            	mark the log entry and tested against a mask to determine if log 
 80            	entry should be written.
 81            	@param formatString	Format definition string for the Log. See the 
 82            	Formatter for details.
 83            	@param Arg0 - Arg 9 - Up to 9 arguments representing the variables
 84            	that go into the log entry.
 85 mike  1.8      <pre>
 86                Logger::put(Logger::TRACE_LOG, "CIMServer", Logger::WARNING,
 87            	"X=$0, Y=$1, Z=$2", 88,  "Hello World", 7.5);
 88                </pre>
 89                */
 90                static void put(
 91            	LogFileType logFileType,
 92            	const String& systemId,
 93            	Uint32 severity,
 94            	const String& formatString,
 95            	const Formatter::Arg& arg0 = Formatter::Arg(),
 96            	const Formatter::Arg& arg1 = Formatter::Arg(),
 97            	const Formatter::Arg& arg2 = Formatter::Arg(),
 98            	const Formatter::Arg& arg3 = Formatter::Arg(),
 99            	const Formatter::Arg& arg4 = Formatter::Arg(),
100            	const Formatter::Arg& arg5 = Formatter::Arg(),
101            	const Formatter::Arg& arg6 = Formatter::Arg(),
102            	const Formatter::Arg& arg7 = Formatter::Arg(),
103            	const Formatter::Arg& arg8 = Formatter::Arg(),
104            	const Formatter::Arg& arg9 = Formatter::Arg());
105            
106 mike  1.8      /** setHomeDirectory
107                */
108                static void setHomeDirectory(const String& homeDirectory);
109            
110                /* clean - Cleans the logger files.
111                @param directory Defines the directory that the logs are in
112                */
113                static void clean(const String& directory);
114            
115                /** setSeverityMask
116                */
117                static void setSeverityMask(const Uint32);
118            
119                /** setLogWriteControlMask
120                */
121                static void setLogWriteControlMask(const Uint32);
122            
123            private:
124            
125                static LoggerRep* _rep;
126                static String _homeDirectory;
127 mike  1.8      static Uint32 _severityMask;
128                static Uint32 _writeControlMask;
129            };
130            
131            PEGASUS_NAMESPACE_END
132            
133            #endif /* Pegasus_Logger_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2