1 / 10

The TANGO Logging Service

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

phelan-orr
Download Presentation

The TANGO Logging Service

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The TANGO Logging Service Status Implementation details Possible enhancements

  2. 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)

  3. 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)

  4. 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;

  5. 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?

  6. 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)

  7. TLS: Implementation Details • Compatibility • Use DeviceImplExt to extend DeviceImpl • TLS is a TANGO option • #define TANGO_HAS_LOG4CPP

  8. 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)

  9. TLS: Possible Enhacements • File Targets • rolling mechanism(s) • RollingFileAppender and/or DailyRollingFileAppender • logging_path property • Console Target • any suggestion?

  10. TLS: Demo

More Related