version 1.12, 2002/08/17 00:59:36
|
version 1.17, 2005/01/19 23:48:05
|
|
|
//%///////////////////////////////////////////////////////////////////////////// |
//%2004//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM, |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// The Open Group, Tivoli Systems |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.; |
|
// IBM Corp.; EMC Corporation, The Open Group. |
|
// Copyright (c) 2004 BMC Software; 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 |
|
|
// Author: Sushma Fernandes, Hewlett-Packard Company (sushma_fernandes@hp.com) | // Author: Sushma Fernandes, Hewlett-Packard Company (sushma_fernandes@hp.com) |
// | // |
// Modified By: Jenny Yu, Hewlett-Packard Company (jenny_yu@hp.com) | // Modified By: Jenny Yu, Hewlett-Packard Company (jenny_yu@hp.com) |
|
// Amit K Arora, IBM (amita@in.ibm.com) for PEP#101 |
|
// Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
#include <Pegasus/Common/TraceComponents.h> | #include <Pegasus/Common/TraceComponents.h> |
#include <Pegasus/Common/TraceFileHandler.h> | #include <Pegasus/Common/TraceFileHandler.h> |
#include <Pegasus/Common/Linkage.h> | #include <Pegasus/Common/Linkage.h> |
|
#include <Pegasus/Common/AutoPtr.h> |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
|
} | } |
| |
static void setTraceComponents( | static void setTraceComponents( |
const String traceComponents) |
const String& traceComponents) |
{ | { |
// empty function | // empty function |
} | } |
|
|
/** 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 |
@return 0 if the filepath is valid | @return 0 if the filepath is valid |
1 if an error occurs while opening the file |
1 if the traceFile is an empty string or |
|
if an error occurs while opening the file |
in append mode | in append mode |
*/ | */ |
static Uint32 setTraceFile(const char* traceFile); | static Uint32 setTraceFile(const char* traceFile); |
|
|
components should be separated by ',' | components should be separated by ',' |
*/ | */ |
static void setTraceComponents( | static void setTraceComponents( |
const String traceComponents); |
const String& traceComponents); |
| |
#endif | #endif |
| |
|
|
@return 1 if the components are valid | @return 1 if the components are valid |
0 if one or more components are invalid | 0 if one or more components are invalid |
*/ | */ |
static Boolean isValidComponents(const String traceComponents); |
static Boolean isValidComponents(const String& traceComponents); |
| |
/** Validates the trace components | /** Validates the trace components |
@param traceComponents comma separated list of trace components | @param traceComponents comma separated list of trace components |
|
|
0 if one or more components are invalid | 0 if one or more components are invalid |
*/ | */ |
static Boolean isValidComponents( | static Boolean isValidComponents( |
const String traceComponents, |
const String& traceComponents, |
String& invalidComponents); | String& invalidComponents); |
| |
|
/** Specify the name of the module being traced. If non-empty, this |
|
value is used as an extension to the name of the trace file. |
|
@param moduleName Name of the module being traced. |
|
*/ |
|
static void setModuleName(const String& moduleName); |
|
|
private: | private: |
| |
static const char _COMPONENT_SEPARATOR; | static const char _COMPONENT_SEPARATOR; |
|
|
static const Uint32 _STRLEN_MAX_PID_TID; | static const Uint32 _STRLEN_MAX_PID_TID; |
static const Boolean _SUCCESS; | static const Boolean _SUCCESS; |
static const Boolean _FAILURE; | static const Boolean _FAILURE; |
Boolean* _traceComponentMask; |
AutoArrayPtr<Boolean> _traceComponentMask; |
Uint32 _traceLevelMask; | Uint32 _traceLevelMask; |
TraceFileHandler* _traceHandler; |
AutoPtr<TraceFileHandler> _traceHandler; |
|
String _moduleName; |
static Tracer* _tracerInstance; | static Tracer* _tracerInstance; |
| |
// Message Strings for function Entry and Exit | // Message Strings for function Entry and Exit |