Skip to content

Commit

Permalink
[session] Disable InfoLogger for ReadoutCard
Browse files Browse the repository at this point in the history
  • Loading branch information
kostorr committed Jan 7, 2021
1 parent 2e04e19 commit 30f1f8f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/Lla/Session.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ class Session
LockParameters mLockParams;
std::unique_ptr<InterprocessLockInterface> mLock;
bool mIsStarted = false;

static void disableInfoLogger();
};

} // namespace lla
Expand Down
2 changes: 2 additions & 0 deletions include/Lla/SessionParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ class SessionParameters

private:
std::unique_ptr<ParametersPimpl> mPimpl;

static void disableInfoLogger();
};

} // namespace lla
Expand Down
9 changes: 9 additions & 0 deletions src/Session.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ namespace lla
#pragma message("O2_LLA_BENCH_ENABLED defined")
Session::Session(SessionParameters& params, LockType::Type lockType)
{
Session::disableInfoLogger();
mParams = SessionParameters(params);
checkAndSetParameters();
makeLockName();
Expand All @@ -40,6 +41,7 @@ Session::Session(SessionParameters& params, LockType::Type lockType)

Session::Session(SessionParameters& params)
{
Session::disableInfoLogger();
mParams = SessionParameters(params);
checkAndSetParameters();
makeLockName();
Expand All @@ -48,6 +50,7 @@ Session::Session(SessionParameters& params)

Session::Session(const Session& other)
{
Session::disableInfoLogger();
mSessionName = other.mSessionName;
mCardId = other.mCardId;
mParams = other.mParams;
Expand All @@ -58,6 +61,7 @@ Session::Session(const Session& other)

Session::Session(Session&& other)
{
Session::disableInfoLogger();
mSessionName = other.mSessionName;
mCardId = other.mCardId;
mParams = other.mParams;
Expand Down Expand Up @@ -157,5 +161,10 @@ void Session::makeLockName()
.setLockName(ss.str());
}

void Session::disableInfoLogger()
{
setenv("INFOLOGGER_MODE", "stdout", true);
}

} // namespace lla
} // namespace o2
8 changes: 8 additions & 0 deletions src/SessionParameters.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,19 @@ _PARAMETER_FUNCTIONS(CardId, "card_id")

SessionParameters::SessionParameters() : mPimpl(std::make_unique<ParametersPimpl>())
{
SessionParameters::disableInfoLogger();
}

SessionParameters::SessionParameters(const SessionParameters& other)
{
SessionParameters::disableInfoLogger();
mPimpl = std::make_unique<ParametersPimpl>();
mPimpl->map = other.mPimpl->map;
}

SessionParameters::SessionParameters(SessionParameters&& other)
{
SessionParameters::disableInfoLogger();
mPimpl = std::move(other.mPimpl);
}

Expand Down Expand Up @@ -130,5 +133,10 @@ SessionParameters& SessionParameters::operator=(SessionParameters&& other)
return *this;
}

void SessionParameters::disableInfoLogger()
{
setenv("INFOLOGGER_MODE", "stdout", true);
}

} // namespace lla
} // namespace o2

0 comments on commit 30f1f8f

Please sign in to comment.