Presentation is loading. Please wait.

Presentation is loading. Please wait.

ACS Logging System APIs: C++ Bogdan Jeram European Southern Observatory July 2004NRAO.

Similar presentations


Presentation on theme: "ACS Logging System APIs: C++ Bogdan Jeram European Southern Observatory July 2004NRAO."— Presentation transcript:

1 ACS Logging System APIs: C++ Bogdan Jeram (bjeram@eso.org) European Southern Observatory July 2004NRAO

2 ALMA Project ACS Course, July 2004ACS Logging System APIs: C++2 Architecture Application (C++) Centralized logger (Telecom Log COS) stdout - screen L o p g r g o I x n y g local cache - file Notification channel macro L A o g C g I E n g Client jlog client ACS log SVC Application (non C++ & Java)

3 ALMA Project ACS Course, July 2004ACS Logging System APIs: C++3 Logging System in C++ based on ACE logging defined callback ( LoggingProxy ) defined macros implementation of Centralized Log e.g. Telecom Log CORBA service ACS Log SVCS

4 ALMA Project ACS Course, July 2004ACS Logging System APIs: C++4 Initialisation should be done in every thread ! already done by the Container and the Simple client LoggingProxy m_logger (cacheSize, minCachePrio, maxCachePrio); LoggingProxy::init (&m_logger); additional configuration: host name, centralized logger, … LoggingProxy::done();

5 ALMA Project ACS Course, July 2004ACS Logging System APIs: C++5 C++ log macros Generic: ACS_LOG (flag, routine, log) log: ACE log message: ( log type, msg)

6 ALMA Project ACS Course, July 2004ACS Logging System APIs: C++6 ACE log messages Flags: –LM_RUNTIME_CONTEXT –LM_SOURCE_INFO Log types and default priorities: –LM_TRACE (2) –LM_DEBUG (3) –LM_INFO (4) –LM_NOTICE (5) –LM_WARNING (6) –LM_ERROR (8) –LM_CRITICAL (9) –LM_ALERT (10) –LM_EMERGENCY (11)

7 ALMA Project ACS Course, July 2004ACS Logging System APIs: C++7 C++ log macros Specialized: ACS_DEBUG( routine, msg) ACS_DEBUG_PARAM (routine, msg, param) ACS_TRACE (routine) ACS_SHORT_LOG (log)

8 ALMA Project ACS Course, July 2004ACS Logging System APIs: C++8 Examples of creating a message ACS_DEBUG( "BaciTestClass::~BaciTestClass“, "COB destroyed“ ); ACS_LOG(LM_RUNTIME_CONTEXT, "maci::ActivatorImpl::init", (LM_INFO, "Activator '%s' initialized successfuly", m_activator_name) );

9 ALMA Project ACS Course, July 2004ACS Logging System APIs: C++9 Configuring at construction time: LoggingProxy via the Configuration Database: environment variables: –set the priority for sending logs to stdout: ACS_LOG_STDOUT –set the file for the local cache: ACS_LOG_FILE

10 ALMA Project ACS Course, July 2004ACS Logging System APIs: C++10 ACS log service ACS service started with: acsStartORBSVC access to the ACS logging system if native support for logging is not available reference can be obtained via the Manager (ACSLogSvc)

11 ALMA Project ACS Course, July 2004ACS Logging System APIs: C++11 IDL interface LogSvc void logTrace(in TimeStamp time, in string msg, in RTContext rtCont, in SourceInfo srcInfo, in NVPairSeq data) raises (ACSErr::ACSException); void logDebug(in TimeStamp time, in string msg, in RTContext rtCont, in SourceInfo srcInfo, in NVPairSeq data) raises (ACSErr::ACSException); void logInfo(in TimeStamp time, in string msg, in RTContext rtCont, in SourceInfo srcInfo, in NVPairSeq data) raises (ACSErr::ACSException); void logNotice(in TimeStamp time, in string msg, in RTContext rtCont, in SourceInfo srcInfo, in NVPairSeq data) raises (ACSErr::ACSException); void logWarning(in TimeStamp time, in string msg, in RTContext rtCont, in SourceInfo srcInfo, in NVPairSeq data) raises (ACSErr::ACSException); void logError(in ACSErr::ErrorTrace c) raises (ACSErr::ACSException); void logCritical(in TimeStamp time, in string msg, in RTContext rtCont, in SourceInfo srcInfo, in NVPairSeq data) raises (ACSErr::ACSException); void logAlert(in TimeStamp time, in string msg, in RTContext rtCont, in SourceInfo srcInfo, in NVPairSeq data) raises (ACSErr::ACSException); void logEmergency(in TimeStamp time, in string msg, in RTContext rtCont, in SourceInfo srcInfo, in NVPairSeq data) raises (ACSErr::ACSException); void logXML(in XMLstring xml) raises (ACSErr::ACSException); };

12 ALMA Project ACS Course, July 2004ACS Logging System APIs: C++12 References Logging and Archiving: http://www.eso.org/~gchiozzi/AlmaAcs/Onl ineDocs/Logging_and_Archiving.pdf http://www.eso.org/~gchiozzi/AlmaAcs/Onl ineDocs/Logging_and_Archiving.pdf logging doxygen documentation: $ACSROOT/man/cpp/logging_8h.html ACS Log SVCS doxygen documentation: $ACSROOT/man/idl/acslog_8idl.html

13 ALMA Project ACS Course, July 2004ACS Logging System APIs: C++13 Exercises Put into your example some log message: –trace messages: ACS_TRACE –debug message: ACS_DEBUG –try to replace ACS__TRACE/ACS_DEBUG with ACS_LOG (try different combination of flags) play with environment variables: –ACS_LOG_STDOUT –ACS_LOG_FILE try jlog log client


Download ppt "ACS Logging System APIs: C++ Bogdan Jeram European Southern Observatory July 2004NRAO."

Similar presentations


Ads by Google