ONE - On-device Neural Engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
hermes::Context Class Referencefinal

Logging controller. More...

#include <Context.h>

Collaboration diagram for hermes::Context:

Public Member Functions

const Configconfig (void) const
 Get the global configuration.
 
void config (std::unique_ptr< Config > &&)
 Update the global configuration.
 
MessageBusbus (void)
 
Source::Registrysources (void)
 
Sink::Registrysinks (void)
 

Detailed Description

Logging controller.

This "Context" serves as a controller for associated logging source/sink.

WARNING This "Context" is not yet thread-safe. TODO Support multi-threaded application logging

Definition at line 39 of file Context.h.

Member Function Documentation

◆ bus()

MessageBus * hermes::Context::bus ( void  )
inline

◆ config() [1/2]

void hermes::Context::config ( std::unique_ptr< Config > &&  config)

Update the global configuration.

Definition at line 30 of file Context.cpp.

31{
32 _config = std::move(config);
33
34 // Apply updated configurations
35 for (auto source : _sources)
36 {
37 source->reload(_config.get());
38 }
39}
const Config * config(void) const
Get the global configuration.
Definition Context.cpp:24

References config().

◆ config() [2/2]

const Config * hermes::Context::config ( void  ) const

Get the global configuration.

Definition at line 24 of file Context.cpp.

25{
26 // Return the current configuration
27 return _config.get();
28}

Referenced by config(), circlechef::LoggingContext::get(), exo::LoggingContext::get(), luci::LoggingContext::get(), moco::LoggingContext::get(), tflchef::LoggingContext::get(), and main().

◆ sinks()

Sink::Registry * hermes::Context::sinks ( void  )
inline

◆ sources()

Source::Registry * hermes::Context::sources ( void  )
inline

The documentation for this class was generated from the following files: