version 1.21, 2003/10/22 14:26:04
|
version 1.22, 2004/06/03 15:04:54
|
|
|
// 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 |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
#include <Pegasus/Common/Tracer.h> | #include <Pegasus/Common/Tracer.h> |
#include <Pegasus/Common/Destroyer.h> |
|
#include <Pegasus/Common/Thread.h> | #include <Pegasus/Common/Thread.h> |
#include <Pegasus/Common/IPC.h> | #include <Pegasus/Common/IPC.h> |
#include <Pegasus/Common/System.h> | #include <Pegasus/Common/System.h> |
|
|
Tracer::Tracer() | Tracer::Tracer() |
{ | { |
// Initialize Trace File Handler | // Initialize Trace File Handler |
_traceHandler=new TraceFileHandler(); |
_traceHandler.reset(new TraceFileHandler()); |
_traceLevelMask=0; | _traceLevelMask=0; |
_traceComponentMask=new Boolean[_NUM_COMPONENTS]; |
_traceComponentMask.reset(new Boolean[_NUM_COMPONENTS]); |
| |
// Initialize ComponentMask array to false | // Initialize ComponentMask array to false |
for (Uint32 index=0;index < _NUM_COMPONENTS; | for (Uint32 index=0;index < _NUM_COMPONENTS; |
_traceComponentMask[index++]=false); |
(_traceComponentMask.get())[index++]=false); |
} | } |
| |
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
|
|
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
Tracer::~Tracer() | Tracer::~Tracer() |
{ | { |
delete []_traceComponentMask; |
|
delete _traceHandler; |
|
delete _tracerInstance; | delete _tracerInstance; |
} | } |
| |
|
|
{ | { |
return false; | return false; |
} | } |
return ((instance->_traceComponentMask[traceComponent]) && |
return (((instance->_traceComponentMask.get())[traceComponent]) && |
(traceLevel & instance->_traceLevelMask)); | (traceLevel & instance->_traceLevelMask)); |
} | } |
| |
|
|
if (String::equalNoCase(componentStr,"ALL")) | if (String::equalNoCase(componentStr,"ALL")) |
{ | { |
for (index=0; index < _NUM_COMPONENTS; | for (index=0; index < _NUM_COMPONENTS; |
_getInstance()->_traceComponentMask[index++] = true); |
(_getInstance()->_traceComponentMask.get())[index++] = true); |
return ; | return ; |
} | } |
| |
// initialise ComponentMask array to False | // initialise ComponentMask array to False |
for (index = 0;index < _NUM_COMPONENTS; | for (index = 0;index < _NUM_COMPONENTS; |
_getInstance()->_traceComponentMask[index++] = false); |
(_getInstance()->_traceComponentMask.get())[index++] = false); |
| |
// Append _COMPONENT_SEPARATOR to the end of the traceComponents | // Append _COMPONENT_SEPARATOR to the end of the traceComponents |
componentStr.append(_COMPONENT_SEPARATOR); | componentStr.append(_COMPONENT_SEPARATOR); |
|
|
if (String::equalNoCase( | if (String::equalNoCase( |
componentName,TRACE_COMPONENT_LIST[index])) | componentName,TRACE_COMPONENT_LIST[index])) |
{ | { |
_getInstance()->_traceComponentMask[index]=true; |
(_getInstance()->_traceComponentMask.get())[index]=true; |
| |
// Found component, break from the loop | // Found component, break from the loop |
break; | break; |
|
|
{ | { |
// initialise ComponentMask array to False | // initialise ComponentMask array to False |
for (Uint32 index = 0;index < _NUM_COMPONENTS; | for (Uint32 index = 0;index < _NUM_COMPONENTS; |
_getInstance()->_traceComponentMask[index++] = false); |
(_getInstance()->_traceComponentMask.get())[index++] = false); |
} | } |
return ; | return ; |
} | } |