version 1.28, 2006/01/30 16:17:36
|
version 1.29, 2006/11/14 18:34:50
|
|
|
// | // |
//============================================================================== | //============================================================================== |
// | // |
// Author: Nag Boranna (nagaraja_boranna@hp.com) |
|
// |
|
// Modified By: Yi Zhou (yi_zhou@hp.com) |
|
// Sushma Fernandes (sushma_fernandes@hp.com) |
|
// Aruran, IBM (ashanmug@in.ibm.com) for Bug# 3614 |
|
// Vijay Eli, IBM, (vijayeli@in.ibm.com) for Bug# 3613 |
|
// Aruran, IBM (ashanmug@in.ibm.com) for Bug# 3613 |
|
// |
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
| |
|
|
| |
#include <Pegasus/Common/Tracer.h> | #include <Pegasus/Common/Tracer.h> |
#include <Pegasus/Common/FileSystem.h> | #include <Pegasus/Common/FileSystem.h> |
#include <Pegasus/Common/MessageLoader.h> //l10n |
#include <Pegasus/Common/MessageLoader.h> |
#include "ConfigManager.h" | #include "ConfigManager.h" |
#include "TracePropertyOwner.h" | #include "TracePropertyOwner.h" |
| |
|
|
#endif | #endif |
#endif | #endif |
#ifdef PEGASUS_OS_OS400 | #ifdef PEGASUS_OS_OS400 |
{"traceFilePath", "/qibm/userdata/os400/cim/cimserver.trc", IS_DYNAMIC, 0, 0, IS_VISIBLE}, |
{"traceFilePath", "/qibm/userdata/os400/cim/cimserver.trc", |
#elif defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) && defined(PEGASUS_USE_RELEASE_DIRS) |
IS_DYNAMIC, 0, 0, IS_VISIBLE}, |
|
#elif defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) && \ |
|
defined(PEGASUS_USE_RELEASE_DIRS) |
{"traceFilePath", "/tmp/cimserver.trc", IS_DYNAMIC, 0, 0, IS_VISIBLE}, | {"traceFilePath", "/tmp/cimserver.trc", IS_DYNAMIC, 0, 0, IS_VISIBLE}, |
#else | #else |
{"traceFilePath", "cimserver.trc", IS_DYNAMIC, 0, 0, IS_VISIBLE}, | {"traceFilePath", "cimserver.trc", IS_DYNAMIC, 0, 0, IS_VISIBLE}, |
|
|
{ | { |
if ( traceLevel == "1" ) | if ( traceLevel == "1" ) |
{ | { |
return (Tracer::LEVEL1); |
return Tracer::LEVEL1; |
} | } |
else if ( traceLevel == "2" ) | else if ( traceLevel == "2" ) |
{ | { |
return (Tracer::LEVEL2); |
return Tracer::LEVEL2; |
} | } |
else if ( traceLevel == "3" ) | else if ( traceLevel == "3" ) |
{ | { |
return (Tracer::LEVEL3); |
return Tracer::LEVEL3; |
} | } |
else | else |
{ | { |
return (Tracer::LEVEL4); |
return Tracer::LEVEL4; |
} | } |
} | } |
| |
|
|
_traceComponents->dynamic = properties[i].dynamic; | _traceComponents->dynamic = properties[i].dynamic; |
_traceComponents->domain = properties[i].domain; | _traceComponents->domain = properties[i].domain; |
_traceComponents->domainSize = properties[i].domainSize; | _traceComponents->domainSize = properties[i].domainSize; |
_traceComponents->externallyVisible = properties[i].externallyVisible; |
_traceComponents->externallyVisible = |
|
properties[i].externallyVisible; |
} | } |
else if (String::equalNoCase(properties[i].propertyName, "traceLevel")) | else if (String::equalNoCase(properties[i].propertyName, "traceLevel")) |
{ | { |
|
|
_traceLevel->dynamic = properties[i].dynamic; | _traceLevel->dynamic = properties[i].dynamic; |
_traceLevel->domain = properties[i].domain; | _traceLevel->domain = properties[i].domain; |
_traceLevel->domainSize = properties[i].domainSize; | _traceLevel->domainSize = properties[i].domainSize; |
_traceLevel->externallyVisible = properties[i].externallyVisible; |
_traceLevel->externallyVisible = |
|
properties[i].externallyVisible; |
} | } |
else if (String::equalNoCase(properties[i].propertyName, "traceFilePath")) |
else if (String::equalNoCase( |
|
properties[i].propertyName, "traceFilePath")) |
{ | { |
_traceFilePath->propertyName = properties[i].propertyName; | _traceFilePath->propertyName = properties[i].propertyName; |
_traceFilePath->defaultValue = properties[i].defaultValue; | _traceFilePath->defaultValue = properties[i].defaultValue; |
|
|
_traceFilePath->dynamic = properties[i].dynamic; | _traceFilePath->dynamic = properties[i].dynamic; |
_traceFilePath->domain = properties[i].domain; | _traceFilePath->domain = properties[i].domain; |
_traceFilePath->domainSize = properties[i].domainSize; | _traceFilePath->domainSize = properties[i].domainSize; |
_traceFilePath->externallyVisible = properties[i].externallyVisible; |
_traceFilePath->externallyVisible = |
|
properties[i].externallyVisible; |
} | } |
} | } |
| |
|
|
{ | { |
if (String::equalNoCase(_traceComponents->propertyName, name)) | if (String::equalNoCase(_traceComponents->propertyName, name)) |
{ | { |
if (_traceFilePath->currentValue != String::EMPTY && value != String::EMPTY) |
if (_traceFilePath->currentValue != String::EMPTY && |
|
value != String::EMPTY) |
{ | { |
CString fileName = ConfigManager::getHomedPath( | CString fileName = ConfigManager::getHomedPath( |
_traceFilePath->currentValue).getCString(); | _traceFilePath->currentValue).getCString(); |
|
|
// Check whether the filepath was set | // Check whether the filepath was set |
if ( retCode == 1 ) | if ( retCode == 1 ) |
{ | { |
//l10n |
|
//Logger::put(Logger::DEBUG_LOG,System::CIMSERVER, |
|
// Logger::WARNING, |
|
//"Unable to write to trace file $0", |
|
//(const char*)fileName); |
|
Logger::put_l(Logger::DEBUG_LOG,System::CIMSERVER, | Logger::put_l(Logger::DEBUG_LOG,System::CIMSERVER, |
Logger::WARNING, | Logger::WARNING, |
"Config.TracePropertyOwner.UNABLE_TO_WRITE_TRACE_FILE", | "Config.TracePropertyOwner.UNABLE_TO_WRITE_TRACE_FILE", |
|
|
// Check whether the filepath was set | // Check whether the filepath was set |
if ( retCode == 1 ) | if ( retCode == 1 ) |
{ | { |
//l10n |
|
//Logger::put(Logger::DEBUG_LOG,System::CIMSERVER, |
|
//Logger::WARNING, |
|
//"Unable to write to trace file $0", |
|
//(const char*)fileName); |
|
Logger::put_l(Logger::DEBUG_LOG,System::CIMSERVER, | Logger::put_l(Logger::DEBUG_LOG,System::CIMSERVER, |
Logger::WARNING, | Logger::WARNING, |
"Config.TracePropertyOwner.UNABLE_TO_WRITE_TRACE_FILE", | "Config.TracePropertyOwner.UNABLE_TO_WRITE_TRACE_FILE", |
|
|
/** | /** |
Checks to see if the given value is valid or not. | Checks to see if the given value is valid or not. |
*/ | */ |
Boolean TracePropertyOwner::isValid(const String& name, const String& value) const |
Boolean TracePropertyOwner::isValid( |
|
const String& name, |
|
const String& value) const |
{ | { |
if (String::equalNoCase(_traceComponents->propertyName, name)) | if (String::equalNoCase(_traceComponents->propertyName, name)) |
{ | { |
|
|
return (configProperty->dynamic==IS_DYNAMIC); | return (configProperty->dynamic==IS_DYNAMIC); |
} | } |
| |
|
|
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |