100 likes | 237 Views
The TANGO Logging Service. Status Implementation details Possible enhancements. TLS: Status. Usable prototype Available for C++ TANGO devices… …but easily portable Java (log4j + port of the C++ implementation) Python (binding of the DeviceProxy class) tested under Linux and Win32
E N D
The TANGO Logging Service Status Implementation details Possible enhancements
TLS: Status • Usable prototype • Available for C++ TANGO devices… • …but easily portable • Java (log4j + port of the C++ implementation) • Python (binding of the DeviceProxy class) • tested under Linux and Win32 • Logging is controlled on a per device basis • TANGO Device = smallest controllable entity • Logging Level • 1 device <-> 1 logging level (for all targets) • OFF < FATAL < ERROR < WARN < INFO < DEBUG • Logging Targets • 1 . Console (cout) • N . XML Files (Chainsaw format) • N . LogConsumer device or any device::log(DevVarStringArray)
TLS: Status • Controlling the logging behavior of a device • @ startup (static configuration) • logging from the device constructor • 2 device properties • logging_level • logging_target • no command line option (required?) • @ runtime (dynamic configuration) • change logging level • add/remove logging targets • 2 ways • Dserver’s TANGO commands • DeviceProxy methods (requests forwarded to DServer)
TLS: Status • Syntax • 10 easy to use macros • 5 with “printf” like syntax: • LOG_{FATAL, ERROR, WARN, INFO, DEBUG} • LOG_DEBUG((“Msg#%d - Hello world”, i++)); • 5 with C++ stream syntax: • {FATAL, ERROR, WARN, INFO, DEBUG}_STREAM • DEBUG_STREAM << “Msg#” << i++ << “- Hello world” << ENDLOG;
TLS: Status • Limitations • Can’t log TANGO core messages • Granularity : one logger per device • cout1…4 macros should use the “current” device’s logger. How to do this? • TSS required • attach device’s logger to the current thread in CORBA methods (IDL) • polling thread uses the DServer’s logger • map cout1…4 to {INFO or DEBUG}_STREAM • map endl to ENDLOG • Side effects and drawbacks • example: Dserver::Init • No perfect solution! • Conclusion?
TLS: Implementation Details • TANGO Core: DServer • AddLoggingTarget( [{devname_pattern, tg_type, tg_name}, …]) • RemoveLoggingTarget( [{devname_pattern, tg_type, tg_name}, …]) • GetLoggingLevel ([devname]) • SetLoggingLevel ([level], [devname]) • GetLoggingTarget (devname) • StopLogging () • StartLogging () • C++ API: DeviceProxy • add_logging_target • remove_logging_target • get_logging_level • set_logging_level (devname) • get_logging_target (devname)
TLS: Implementation Details • Compatibility • Use DeviceImplExt to extend DeviceImpl • TLS is a TANGO option • #define TANGO_HAS_LOG4CPP
TLS: Possible Enhacements • LogConsumer Targets • Use TANGO events… • use case: machine (notification service) • simplify “producer” code • only one connection • worse case: only one “zombie appender” per device • “logging_channel” device property • Use TANGO Asynchronous Calls • use case: experiments (no notification service) • send and forget (non blocking mode)
TLS: Possible Enhacements • File Targets • rolling mechanism(s) • RollingFileAppender and/or DailyRollingFileAppender • logging_path property • Console Target • any suggestion?