From 1b9bc54f318cc2db3392aac3f4db8008e5b41114 Mon Sep 17 00:00:00 2001 From: MALFREYT <alexandre.malfreyt@synchrotron-soleil.fr> Date: Thu, 20 Feb 2025 09:48:01 +0100 Subject: [PATCH] cleanup: add info attr & replace log attr (using yat4tango::Logging) --- src/SingleShotAO.cpp | 17 ++++++++++++++--- src/SingleShotAO.h | 3 +++ src/SingleShotAOManager.h | 1 - 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/SingleShotAO.cpp b/src/SingleShotAO.cpp index 7d1e7d3..46a79c4 100755 --- a/src/SingleShotAO.cpp +++ b/src/SingleShotAO.cpp @@ -70,6 +70,8 @@ static const char *RcsId = "$Id: DevServ.cpp 13293 2009-04-07 10:53:56Z pascal_v #include <tango.h> +#include <yat4tango/Logging.h> +#include <yat4tango/DeviceInfo.h> #include <SingleShotAO.h> #include <SingleShotAOClass.h> #include "SingleShotAOTypesAndConsts.h" @@ -164,7 +166,8 @@ void SingleShotAO::delete_device() } //- remove the inner appender - yat4tango::InnerAppender::release(this); + yat4tango::Logging::release(this); + yat4tango::DeviceInfo::release(this); } @@ -180,9 +183,15 @@ void SingleShotAO::init_device() //- initialize the inner appender (first thing to do) try { - yat4tango::InnerAppender::initialize(this); + INFO_STREAM << "Create the InnerAppender & FileAppender in order to manage logs." << endl; + yat4tango::Logging::initialize(this); + + INFO_STREAM << "Create the DeviceInfo in order to manage info on versions." << endl; + yat4tango::DeviceInfo::initialize(this, YAT_XSTR(PROJECT_NAME), YAT_XSTR(PROJECT_VERSION)); + // yat4tango::DeviceInfo::add_dependency(this, "Dependency Name", YAT_XSTR(dependency_name_PROJECT_VERSION)); + // TODO: Add dependencies } - catch( Tango::DevFailed& df ) + catch (Tango::DevFailed &df) { ERROR_STREAM << df << std::endl; m_state = Tango::FAULT; @@ -190,6 +199,8 @@ void SingleShotAO::init_device() return; } + INFO_STREAM << "Initializing device"; + //- trace/profile this method yat4tango::TraceHelper t("SingleShotAO::init_device", this); diff --git a/src/SingleShotAO.h b/src/SingleShotAO.h index 8eb2b20..4289487 100755 --- a/src/SingleShotAO.h +++ b/src/SingleShotAO.h @@ -48,6 +48,9 @@ #include <tango.h> //using namespace Tango; +#include <yat4tango/Logging.h> +#include <yat4tango/DeviceInfo.h> + #include "SingleShotAOManager.h" /** diff --git a/src/SingleShotAOManager.h b/src/SingleShotAOManager.h index 4343759..27e73ce 100644 --- a/src/SingleShotAOManager.h +++ b/src/SingleShotAOManager.h @@ -19,7 +19,6 @@ #include "SingleShotAOTypesAndConsts.h" #include <asl/SingleShotAO.h> /*Use YAT library*/ -#include <yat4tango/InnerAppender.h> #include <yat/memory/DataBuffer.h> #include <yat4tango/PropertyHelper.h> #include <map> -- GitLab