From f055227056f210347ad37398b6974ae27542e0e9 Mon Sep 17 00:00:00 2001
From: P-A Loizeau <p.-a.loizeau@gsi.de>
Date: Wed, 9 Oct 2024 17:27:18 +0200
Subject: [PATCH] Bugfix: in algo, replace all occurences of log.hpp includes
 with the FairLogger compat header

---
 algo/base/Options.cxx                    |  5 ++++-
 algo/base/Options.h                      |  6 +++++-
 algo/base/util/MemoryLogger.cxx          |  3 +--
 algo/data/sts/LandauTable.cxx            |  2 +-
 algo/detectors/bmon/ReadoutConfig.cxx    |  2 +-
 algo/detectors/bmon/Unpack.cxx           |  2 +-
 algo/detectors/bmon/UnpackMS.cxx         |  3 ++-
 algo/detectors/much/Unpack.cxx           |  2 +-
 algo/detectors/rich/Unpack.cxx           |  2 +-
 algo/detectors/sts/HitfinderChain.cxx    | 22 ++++++++++++++++++++--
 algo/detectors/sts/ReadoutConfig.cxx     |  2 +-
 algo/detectors/sts/TrackingInterface.cxx |  2 +-
 algo/detectors/sts/Unpack.cxx            |  2 +-
 algo/detectors/sts/UnpackMS.cxx          |  2 +-
 algo/detectors/tof/Calibrate.cxx         |  2 +-
 algo/detectors/tof/Hitfind.cxx           |  2 +-
 algo/detectors/tof/ReadoutConfig.cxx     |  2 +-
 algo/detectors/tof/TrackingInterface.cxx |  2 +-
 algo/detectors/tof/Unpack.cxx            |  2 +-
 algo/detectors/trd/Cluster2D.cxx         | 10 +++++-----
 algo/detectors/trd/HitFactory2D.cxx      |  2 +-
 algo/detectors/trd/HitFinder2D.cxx       |  2 +-
 algo/detectors/trd/HitMerger2D.cxx       |  2 +-
 algo/detectors/trd/Hitfind.cxx           |  2 +-
 algo/detectors/trd/TrackingInterface.cxx |  2 +-
 algo/detectors/trd/Unpack.cxx            |  2 +-
 algo/detectors/trd/UnpackMS.cxx          |  3 ++-
 algo/detectors/trd2d/Unpack.cxx          |  2 +-
 algo/global/Reco.cxx                     |  2 +-
 algo/qa/CanvasConfig.cxx                 |  3 ++-
 algo/qa/PadConfig.cxx                    |  3 ++-
 algo/qa/QaData.h                         |  2 +-
 algo/unpack/CommonUnpacker.cxx           |  2 --
 algo/unpack/CommonUnpacker.h             |  2 +-
 34 files changed, 67 insertions(+), 41 deletions(-)

diff --git a/algo/base/Options.cxx b/algo/base/Options.cxx
index 85b256b6c9..ea9ecace39 100644
--- a/algo/base/Options.cxx
+++ b/algo/base/Options.cxx
@@ -27,7 +27,7 @@ namespace std
   }
 }  // namespace std
 
-
+#ifndef CBM_ONLINE_USE_FAIRLOGGER
 void validate(boost::any& v, const std::vector<std::string>& values, severity_level*, int)
 {
 
@@ -46,6 +46,7 @@ void validate(boost::any& v, const std::vector<std::string>& values, severity_le
 
   v = it->second;
 }
+#endif  // Not CBM_ONLINE_USE_FAIRLOGGER
 
 Options::Options(int argc, char** argv)
 {
@@ -67,8 +68,10 @@ Options::Options(int argc, char** argv)
       "write results to file")
     ("device,d", po::value(&fDevice)->default_value("cpu")->value_name("<device>"),
       "select device (cpu, cuda0, cuda1, hip0, ...)")
+#ifndef CBM_ONLINE_USE_FAIRLOGGER
     ("log-level,l", po::value(&fLogLevel)->default_value(info)->value_name("<level>"),
       "set log level (debug, info, warning, error, fatal)")
+#endif  // Not CBM_ONLINE_USE_FAIRLOGGER
     ("monitor,m", po::value(&fMonitorUri)->value_name("<uri>")->implicit_value("file:cout"),
       "URI specifying monitor output (e.g. file:/tmp/monitor.txt, influx1:login:8086:cbmreco_status). Prints to cout when no argument is given. Monitor is disabled when flag is not set.")
     ("histogram", po::value(&fHistogramUri)->value_name("<uri>"), "URI to specify histogram server")
diff --git a/algo/base/Options.h b/algo/base/Options.h
index b5247796c6..5a9d232fca 100644
--- a/algo/base/Options.h
+++ b/algo/base/Options.h
@@ -4,9 +4,9 @@
 #ifndef CBM_ALGO_BASE_OPTIONS_H
 #define CBM_ALGO_BASE_OPTIONS_H
 
+#include "AlgoFairloggerCompat.h"
 #include "Definitions.h"
 #include "compat/Filesystem.h"
-#include "log.hpp"
 #include "util/ProfilingLevel.h"
 
 #include <set>
@@ -25,7 +25,9 @@ namespace cbm::algo
     fs::path ParamsDir() const { return fParamsDir; }
     const std::string& InputLocator() const { return fInputLocator; }
     fs::path OutputFile() const { return fOutputFile; }
+#ifndef CBM_ONLINE_USE_FAIRLOGGER
     severity_level LogLevel() const { return fLogLevel; }
+#endif  // Not CBM_ONLINE_USE_FAIRLOGGER
     fs::path LogFile() const { return fLogFile; }
     const std::string& Device() const { return fDevice; }
     const std::string& MonitorUri() const { return fMonitorUri; }
@@ -70,7 +72,9 @@ namespace cbm::algo
     std::string fParamsDir;  // TODO: can we make this a std::path?
     std::string fInputLocator;
     std::string fOutputFile;
+#ifndef CBM_ONLINE_USE_FAIRLOGGER
     severity_level fLogLevel;
+#endif  // Not CBM_ONLINE_USE_FAIRLOGGER
     std::string fLogFile;
     std::string fDevice;
     std::string fMonitorUri;
diff --git a/algo/base/util/MemoryLogger.cxx b/algo/base/util/MemoryLogger.cxx
index 61c4777219..ac50ef9f8b 100644
--- a/algo/base/util/MemoryLogger.cxx
+++ b/algo/base/util/MemoryLogger.cxx
@@ -4,10 +4,9 @@
 
 #include "MemoryLogger.h"
 
+#include "AlgoFairloggerCompat.h"
 #include "System.h"
 
-#include <log.hpp>
-
 using namespace cbm::algo;
 
 template<typename T>
diff --git a/algo/data/sts/LandauTable.cxx b/algo/data/sts/LandauTable.cxx
index 6192a14541..7d466c38ee 100644
--- a/algo/data/sts/LandauTable.cxx
+++ b/algo/data/sts/LandauTable.cxx
@@ -3,7 +3,7 @@
    Authors: Felix Weiglhofer [committer] */
 #include "LandauTable.h"
 
-#include "log.hpp"
+#include "AlgoFairloggerCompat.h"
 
 #include <fstream>
 
diff --git a/algo/detectors/bmon/ReadoutConfig.cxx b/algo/detectors/bmon/ReadoutConfig.cxx
index 975e8206f3..dc8c325b6e 100644
--- a/algo/detectors/bmon/ReadoutConfig.cxx
+++ b/algo/detectors/bmon/ReadoutConfig.cxx
@@ -4,13 +4,13 @@
 
 #include "ReadoutConfig.h"
 
+#include "AlgoFairloggerCompat.h"
 #include "CbmTofAddress.h"
 #include "Exceptions.h"
 #include "gDpbMessv100.h"
 
 #include <bitset>
 #include <iomanip>
-#include <log.hpp>
 
 #include <fmt/format.h>
 
diff --git a/algo/detectors/bmon/Unpack.cxx b/algo/detectors/bmon/Unpack.cxx
index 165098afea..36dbc050e1 100644
--- a/algo/detectors/bmon/Unpack.cxx
+++ b/algo/detectors/bmon/Unpack.cxx
@@ -4,7 +4,7 @@
 
 #include "Unpack.h"
 
-#include "log.hpp"
+#include "AlgoFairloggerCompat.h"
 
 using namespace cbm::algo::bmon;
 using fles::Subsystem;
diff --git a/algo/detectors/bmon/UnpackMS.cxx b/algo/detectors/bmon/UnpackMS.cxx
index dde62ac44f..4841b63c75 100644
--- a/algo/detectors/bmon/UnpackMS.cxx
+++ b/algo/detectors/bmon/UnpackMS.cxx
@@ -4,9 +4,10 @@
 
 #include "UnpackMS.h"
 
+#include "AlgoFairloggerCompat.h"
+
 #include <cassert>
 #include <cmath>
-#include <log.hpp>
 #include <sstream>
 #include <utility>
 #include <vector>
diff --git a/algo/detectors/much/Unpack.cxx b/algo/detectors/much/Unpack.cxx
index 45f78ba06f..4cc5efd443 100644
--- a/algo/detectors/much/Unpack.cxx
+++ b/algo/detectors/much/Unpack.cxx
@@ -4,7 +4,7 @@
 
 #include "Unpack.h"
 
-#include "log.hpp"
+#include "AlgoFairloggerCompat.h"
 
 using namespace cbm::algo::much;
 using fles::Subsystem;
diff --git a/algo/detectors/rich/Unpack.cxx b/algo/detectors/rich/Unpack.cxx
index efbb1e7ca5..3fb2dd4f50 100644
--- a/algo/detectors/rich/Unpack.cxx
+++ b/algo/detectors/rich/Unpack.cxx
@@ -4,7 +4,7 @@
 
 #include "Unpack.h"
 
-#include "log.hpp"
+#include "AlgoFairloggerCompat.h"
 
 using namespace cbm::algo::rich;
 using fles::Subsystem;
diff --git a/algo/detectors/sts/HitfinderChain.cxx b/algo/detectors/sts/HitfinderChain.cxx
index d999d96290..6f65f46212 100644
--- a/algo/detectors/sts/HitfinderChain.cxx
+++ b/algo/detectors/sts/HitfinderChain.cxx
@@ -4,11 +4,11 @@
 
 #include "HitfinderChain.h"
 
+#include "AlgoFairloggerCompat.h"
 #include "Exceptions.h"
 #include "PODVector.h"
 #include "compat/OpenMP.h"
 
-#include <log.hpp>
 #include <numeric>
 
 using namespace cbm::algo;
@@ -76,7 +76,13 @@ sts::HitfinderChain::Result sts::HitfinderChain::operator()(gsl::span<const CbmS
   // 3. Copy digis into flat array with offsets per module
   FlattenDigis(digis, digiMap);
 
-  if (Opts().LogLevel() == trace) EnsureDigiOffsets(digiMap);
+#ifdef CBM_ONLINE_USE_FAIRLOGGER
+  if (fair::Logger::GetConsoleSeverity() == fair::Severity::trace) {
+#else
+  if (Opts().LogLevel() == trace) {
+#endif  // CBM_ONLINE_USE_FAIRLOGGER
+    EnsureDigiOffsets(digiMap);
+  }
 
   xpu::queue queue;
 
@@ -123,7 +129,11 @@ sts::HitfinderChain::Result sts::HitfinderChain::operator()(gsl::span<const CbmS
 
   queue.launch<SortDigis>(xpu::n_blocks(nModuleSides));
   xpu::k_add_bytes<SortDigis>(nDigisTotal * sizeof(CbmStsDigi));
+#ifdef CBM_ONLINE_USE_FAIRLOGGER
+  if (fair::Logger::GetConsoleSeverity() == fair::Severity::trace) {
+#else
   if (Opts().LogLevel() == trace) {
+#endif  // CBM_ONLINE_USE_FAIRLOGGER
     L_(trace) << "Ensuring STS digis are sorted...";
     queue.copy(hfc.digisPerModule, xpu::d2h);
     queue.copy(hfc.digiOffsetPerModule, xpu::d2h);
@@ -143,7 +153,11 @@ sts::HitfinderChain::Result sts::HitfinderChain::operator()(gsl::span<const CbmS
     queue.launch<CreateClusters>(xpu::n_threads(nDigisTotal));
     xpu::k_add_bytes<CreateClusters>(nDigisTotal * sizeof(CbmStsDigi));
   }
+#ifdef CBM_ONLINE_USE_FAIRLOGGER
+  if (fair::Logger::GetConsoleSeverity() == fair::Severity::trace) {
+#else
   if (Opts().LogLevel() == trace) {
+#endif  // CBM_ONLINE_USE_FAIRLOGGER
     L_(trace) << "Ensuring STS channel offsets correct...";
     xpu::buffer_prop propsOffset{hfc.channelOffsetPerModule};
     std::vector<u32> channelOffsetPerModule;
@@ -200,7 +214,11 @@ sts::HitfinderChain::Result sts::HitfinderChain::operator()(gsl::span<const CbmS
     // TODO: Make number of streams configurable
     hits = SplitHitsIntoStreams(hits, 100);
     SortHitsWithinPartition(hits);
+#ifdef CBM_ONLINE_USE_FAIRLOGGER
+    if (fair::Logger::GetConsoleSeverity() == fair::Severity::trace) {
+#else
     if (Opts().LogLevel() == trace) {
+#endif  // CBM_ONLINE_USE_FAIRLOGGER
       EnsureHitsSorted(hits);
     }
   }
diff --git a/algo/detectors/sts/ReadoutConfig.cxx b/algo/detectors/sts/ReadoutConfig.cxx
index df7c74355d..b972826504 100644
--- a/algo/detectors/sts/ReadoutConfig.cxx
+++ b/algo/detectors/sts/ReadoutConfig.cxx
@@ -3,10 +3,10 @@
    Authors: Volker Friese [committer], Felix Weiglhofer */
 #include "ReadoutConfig.h"
 
+#include "AlgoFairloggerCompat.h"
 #include "CbmStsAddress.h"
 #include "ChannelMaskSet.h"
 #include "Exceptions.h"
-#include "log.hpp"
 
 #include <cassert>
 #include <iomanip>
diff --git a/algo/detectors/sts/TrackingInterface.cxx b/algo/detectors/sts/TrackingInterface.cxx
index fad68ead46..0aedb2b958 100644
--- a/algo/detectors/sts/TrackingInterface.cxx
+++ b/algo/detectors/sts/TrackingInterface.cxx
@@ -9,8 +9,8 @@
 
 #include "TrackingInterface.h"
 
+#include "AlgoFairloggerCompat.h"
 #include "CbmStsAddress.h"
-#include "log.hpp"
 
 using cbm::algo::sts::TrackingInterface;
 
diff --git a/algo/detectors/sts/Unpack.cxx b/algo/detectors/sts/Unpack.cxx
index 44bb67928f..d224f0d4f0 100644
--- a/algo/detectors/sts/Unpack.cxx
+++ b/algo/detectors/sts/Unpack.cxx
@@ -4,7 +4,7 @@
 
 #include "Unpack.h"
 
-#include "log.hpp"
+#include "AlgoFairloggerCompat.h"
 
 using namespace cbm::algo::sts;
 using fles::Subsystem;
diff --git a/algo/detectors/sts/UnpackMS.cxx b/algo/detectors/sts/UnpackMS.cxx
index e71541e3f6..ad00258b2e 100644
--- a/algo/detectors/sts/UnpackMS.cxx
+++ b/algo/detectors/sts/UnpackMS.cxx
@@ -4,8 +4,8 @@
 
 #include "UnpackMS.h"
 
+#include "AlgoFairloggerCompat.h"
 #include "StsXyterMessage.h"
-#include "log.hpp"
 
 #include <cassert>
 #include <cmath>
diff --git a/algo/detectors/tof/Calibrate.cxx b/algo/detectors/tof/Calibrate.cxx
index d61d500ee1..382ead1081 100644
--- a/algo/detectors/tof/Calibrate.cxx
+++ b/algo/detectors/tof/Calibrate.cxx
@@ -4,7 +4,7 @@
 
 #include "Calibrate.h"
 
-#include "log.hpp"
+#include "AlgoFairloggerCompat.h"
 #include "util/TimingsFormat.h"
 
 #include <chrono>
diff --git a/algo/detectors/tof/Hitfind.cxx b/algo/detectors/tof/Hitfind.cxx
index 64c84e533c..119db83b1a 100644
--- a/algo/detectors/tof/Hitfind.cxx
+++ b/algo/detectors/tof/Hitfind.cxx
@@ -4,8 +4,8 @@
 
 #include "Hitfind.h"
 
+#include "AlgoFairloggerCompat.h"
 #include "compat/OpenMP.h"
-#include "log.hpp"
 #include "util/TimingsFormat.h"
 
 #include <chrono>
diff --git a/algo/detectors/tof/ReadoutConfig.cxx b/algo/detectors/tof/ReadoutConfig.cxx
index 4b807c5106..29eb2570da 100644
--- a/algo/detectors/tof/ReadoutConfig.cxx
+++ b/algo/detectors/tof/ReadoutConfig.cxx
@@ -4,13 +4,13 @@
 
 #include "ReadoutConfig.h"
 
+#include "AlgoFairloggerCompat.h"
 #include "CbmTofAddress.h"
 #include "Exceptions.h"
 #include "gDpbMessv100.h"
 
 #include <bitset>
 #include <iomanip>
-#include <log.hpp>
 
 using namespace std;
 
diff --git a/algo/detectors/tof/TrackingInterface.cxx b/algo/detectors/tof/TrackingInterface.cxx
index 69db5638f0..0ed55e5096 100644
--- a/algo/detectors/tof/TrackingInterface.cxx
+++ b/algo/detectors/tof/TrackingInterface.cxx
@@ -9,11 +9,11 @@
 
 #include "TrackingInterface.h"
 
+#include "AlgoFairloggerCompat.h"
 #include "CbmTofAddress.h"
 #include "HitfindSetup.h"
 #include "ParFiles.h"
 #include "fmt/format.h"
-#include "log.hpp"
 
 using cbm::algo::tof::HitfindSetup;
 using cbm::algo::tof::TrackingInterface;
diff --git a/algo/detectors/tof/Unpack.cxx b/algo/detectors/tof/Unpack.cxx
index 7d566cfeb2..1969e4e6a1 100644
--- a/algo/detectors/tof/Unpack.cxx
+++ b/algo/detectors/tof/Unpack.cxx
@@ -4,7 +4,7 @@
 
 #include "Unpack.h"
 
-#include "log.hpp"
+#include "AlgoFairloggerCompat.h"
 
 using namespace cbm::algo::tof;
 using fles::Subsystem;
diff --git a/algo/detectors/trd/Cluster2D.cxx b/algo/detectors/trd/Cluster2D.cxx
index b5e409c004..19d6d2dcec 100644
--- a/algo/detectors/trd/Cluster2D.cxx
+++ b/algo/detectors/trd/Cluster2D.cxx
@@ -4,8 +4,8 @@
 
 #include "Cluster2D.h"
 
+#include "AlgoFairloggerCompat.h"
 #include "CbmTrdDigi.h"
-#include "log.hpp"
 
 #include <cmath>
 
@@ -45,17 +45,17 @@ namespace cbm::algo::trd
   {
     /** Extend basic functionality of Cluster2D::AddDigi() for the case of 2D.
  * If chT < 0 use the basic functionality [default].
- * 
+ *
  * For the 2D the parameters are intergpreted as follows
  * chT : tilted paired channel [default 0x0fffffff]
  * chR : rectangular paired channel
  * dt  : offset in clks of the prompt signal
  *
  * if chT and chR positive the (chT, chR) are interpreted as the 2 channels
- * of the digi specific to the 2D version. The following specific cases 
- * can be distinguished : 
+ * of the digi specific to the 2D version. The following specific cases
+ * can be distinguished :
  *  - ch == 0 : no data, cluster signal sequence terminator
- *  - ch == -ch : no data, channel masked in HW 
+ *  - ch == -ch : no data, channel masked in HW
  */
 
     if (chT == 0xffff) {  // basic functionality for rectangular pads
diff --git a/algo/detectors/trd/HitFactory2D.cxx b/algo/detectors/trd/HitFactory2D.cxx
index 8e21bb2841..2c93cc1ad7 100644
--- a/algo/detectors/trd/HitFactory2D.cxx
+++ b/algo/detectors/trd/HitFactory2D.cxx
@@ -4,7 +4,7 @@
 
 #include "HitFactory2D.h"
 
-#include "log.hpp"
+#include "AlgoFairloggerCompat.h"
 
 #include <numeric>
 
diff --git a/algo/detectors/trd/HitFinder2D.cxx b/algo/detectors/trd/HitFinder2D.cxx
index 67f7a15c20..bff1685914 100644
--- a/algo/detectors/trd/HitFinder2D.cxx
+++ b/algo/detectors/trd/HitFinder2D.cxx
@@ -4,7 +4,7 @@
 
 #include "HitFinder2D.h"
 
-#include "log.hpp"
+#include "AlgoFairloggerCompat.h"
 
 #include <numeric>
 
diff --git a/algo/detectors/trd/HitMerger2D.cxx b/algo/detectors/trd/HitMerger2D.cxx
index aa2cdefc5f..fc4e4a55d5 100644
--- a/algo/detectors/trd/HitMerger2D.cxx
+++ b/algo/detectors/trd/HitMerger2D.cxx
@@ -4,7 +4,7 @@
 
 #include "HitMerger2D.h"
 
-#include "log.hpp"
+#include "AlgoFairloggerCompat.h"
 
 #include <functional>
 #include <numeric>
diff --git a/algo/detectors/trd/Hitfind.cxx b/algo/detectors/trd/Hitfind.cxx
index 0320962a7a..d0cb3f36cd 100644
--- a/algo/detectors/trd/Hitfind.cxx
+++ b/algo/detectors/trd/Hitfind.cxx
@@ -4,8 +4,8 @@
 
 #include "Hitfind.h"
 
+#include "AlgoFairloggerCompat.h"
 #include "compat/OpenMP.h"
-#include "log.hpp"
 #include "util/TimingsFormat.h"
 
 #include <chrono>
diff --git a/algo/detectors/trd/TrackingInterface.cxx b/algo/detectors/trd/TrackingInterface.cxx
index 7b119cb64d..97d67f8085 100644
--- a/algo/detectors/trd/TrackingInterface.cxx
+++ b/algo/detectors/trd/TrackingInterface.cxx
@@ -9,8 +9,8 @@
 
 #include "TrackingInterface.h"
 
+#include "AlgoFairloggerCompat.h"
 #include "CbmTrdAddress.h"
-#include "log.hpp"
 
 using cbm::algo::trd::TrackingInterface;
 
diff --git a/algo/detectors/trd/Unpack.cxx b/algo/detectors/trd/Unpack.cxx
index 55eec70197..6e037ec986 100644
--- a/algo/detectors/trd/Unpack.cxx
+++ b/algo/detectors/trd/Unpack.cxx
@@ -4,7 +4,7 @@
 
 #include "Unpack.h"
 
-#include "log.hpp"
+#include "AlgoFairloggerCompat.h"
 
 using namespace cbm::algo::trd;
 using fles::Subsystem;
diff --git a/algo/detectors/trd/UnpackMS.cxx b/algo/detectors/trd/UnpackMS.cxx
index 40fdd3be35..41310caaa2 100644
--- a/algo/detectors/trd/UnpackMS.cxx
+++ b/algo/detectors/trd/UnpackMS.cxx
@@ -4,9 +4,10 @@
 
 #include "UnpackMS.h"
 
+#include "AlgoFairloggerCompat.h"
+
 #include <algorithm>
 #include <cassert>
-#include <log.hpp>
 #include <vector>
 
 using std::unique_ptr;
diff --git a/algo/detectors/trd2d/Unpack.cxx b/algo/detectors/trd2d/Unpack.cxx
index cc6b25977d..ef628a177d 100644
--- a/algo/detectors/trd2d/Unpack.cxx
+++ b/algo/detectors/trd2d/Unpack.cxx
@@ -4,7 +4,7 @@
 
 #include "Unpack.h"
 
-#include "log.hpp"
+#include "AlgoFairloggerCompat.h"
 
 using namespace cbm::algo::trd2d;
 using fles::Subsystem;
diff --git a/algo/global/Reco.cxx b/algo/global/Reco.cxx
index 96063d3186..003f1c592e 100644
--- a/algo/global/Reco.cxx
+++ b/algo/global/Reco.cxx
@@ -3,6 +3,7 @@
    Authors: Felix Weiglhofer [committer], P.-A. Loizeau */
 #include "Reco.h"
 
+#include "AlgoFairloggerCompat.h"
 #include "AuxDigiData.h"
 #include "BuildInfo.h"
 #include "CbmDigiEvent.h"
@@ -19,7 +20,6 @@
 #include "ca/core/data/CaTrack.h"
 #include "compat/OpenMP.h"
 #include "evbuild/Config.h"
-#include "log.hpp"
 #include "much/Unpack.h"
 #include "rich/Unpack.h"
 #include "sts/ChannelMaskSet.h"
diff --git a/algo/qa/CanvasConfig.cxx b/algo/qa/CanvasConfig.cxx
index 653e33c547..322b082f75 100644
--- a/algo/qa/CanvasConfig.cxx
+++ b/algo/qa/CanvasConfig.cxx
@@ -9,7 +9,8 @@
 
 #include "CanvasConfig.h"
 
-#include <log.hpp>
+#include "AlgoFairloggerCompat.h"
+
 #include <sstream>
 
 using cbm::algo::qa::CanvasConfig;
diff --git a/algo/qa/PadConfig.cxx b/algo/qa/PadConfig.cxx
index 93cdc8741b..bd157e04ea 100644
--- a/algo/qa/PadConfig.cxx
+++ b/algo/qa/PadConfig.cxx
@@ -9,7 +9,8 @@
 
 #include "PadConfig.h"
 
-#include <log.hpp>
+#include "AlgoFairloggerCompat.h"
+
 #include <sstream>
 
 using cbm::algo::qa::PadConfig;
diff --git a/algo/qa/QaData.h b/algo/qa/QaData.h
index b834736336..0c87df69c5 100644
--- a/algo/qa/QaData.h
+++ b/algo/qa/QaData.h
@@ -9,13 +9,13 @@
 
 #pragma once
 
+#include "AlgoFairloggerCompat.h"
 #include "CanvasConfig.h"
 #include "HistogramContainer.h"
 #include "HistogramSender.h"
 
 #include <boost/serialization/forward_list.hpp>
 
-#include <log.hpp>
 #include <memory>
 #include <string_view>
 #include <type_traits>
diff --git a/algo/unpack/CommonUnpacker.cxx b/algo/unpack/CommonUnpacker.cxx
index 6f0f871816..9dc30db579 100644
--- a/algo/unpack/CommonUnpacker.cxx
+++ b/algo/unpack/CommonUnpacker.cxx
@@ -3,8 +3,6 @@
    Authors: Felix Weiglhofer [committer], Dominik Smith */
 #include "CommonUnpacker.h"
 
-#include "log.hpp"
-
 using namespace cbm::algo;
 
 detail::MSData::MSData(const fles::Timeslice& ts, fles::Subsystem subsystem, gsl::span<u16> legalEqIds)
diff --git a/algo/unpack/CommonUnpacker.h b/algo/unpack/CommonUnpacker.h
index e9a3652248..3db3952e78 100644
--- a/algo/unpack/CommonUnpacker.h
+++ b/algo/unpack/CommonUnpacker.h
@@ -3,6 +3,7 @@
    Authors: Felix Weiglhofer [committer], Dominik Smith */
 #pragma once
 
+#include "AlgoFairloggerCompat.h"
 #include "Definitions.h"
 #include "PODVector.h"
 #include "Timeslice.hpp"
@@ -13,7 +14,6 @@
 
 #include <cstdint>
 #include <gsl/span>
-#include <log.hpp>
 #include <map>
 #include <vector>
 
-- 
GitLab