MotorControlModuleSDFM_TMS3.../Projects/EFC_Communication/UMLibrary/application/log/LogProviderInitializer.cpp
2024-06-07 11:12:56 +03:00

29 lines
828 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* LogProvider.cpp
*
* Created on: 23 июл. 2020 г.
* Author: LeonidTitov
*/
#include "LogProvider.hh"
bool application::log::LogProvider::input( Environment & env ) {
return ( on_conter = env.signals.get( links.on_counter ) )
and grab( memory, env.rholder.getShared<std::pmr::memory_resource>( links.object_memory ) );
}
void application::log::LogProvider::build( Environment & env ) {
typedef logging::LoggerProvider LP;
uint32_t on_off = *on_conter;
uint16_t global_permission_policy = (config.allow_information_log << 2) | (config.allow_critical_log << 1) | config.allow_error_log;
LP * lp = memories::instance_object<LP>(env.static_object_ma,memory, global_permission_policy, on_off);
env.rholder.share<logging::LoggerProviderMethods>( *lp, links.provider );
}