Skip to content

Commit

Permalink
[QC-902] tune OCC log levels
Browse files Browse the repository at this point in the history
info becomes detail, which should be translated to IL's debug, but in contrast to FairLogger's debug, it should appear in Release builds.
  • Loading branch information
knopers8 authored and teo committed Feb 2, 2023
1 parent d521df8 commit 81c8fab
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions occ/plugin/OccLiteServer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ ::grpc::Status OccLite::Service::GetState(::grpc::ServerContext* context,
(void) context;
(void) request;

OLOG(info) << "Incoming GetState request: " << request->JsonMessage::Serialize();
OLOG(detail) << "Incoming GetState request: " << request->JsonMessage::Serialize();

auto state = fair::mq::PluginServices::ToStr(m_pluginServices->GetCurrentDeviceState());
pid_t pid = getpid();

response->state = state;
response->pid = pid;
OLOG(info) << "GetState response: " << response->state;
OLOG(detail) << "GetState response: " << response->state;

return grpc::Status::OK;
}
Expand All @@ -95,7 +95,7 @@ ::grpc::Status OccLite::Service::Transition(::grpc::ServerContext* context,
const OccLite::nopb::TransitionRequest* request,
OccLite::nopb::TransitionResponse* response)
{
OLOG(info) << "Incoming Transition request: " << request->JsonMessage::Serialize();
OLOG(detail) << "Incoming Transition request: " << request->JsonMessage::Serialize();

auto transitionOutcome = doTransition(m_pluginServices, *request);
::grpc::Status grpcStatus = std::get<1>(transitionOutcome);
Expand All @@ -106,7 +106,7 @@ ::grpc::Status OccLite::Service::Transition(::grpc::ServerContext* context,

auto nopbResponse = std::get<0>(transitionOutcome);
*response = nopbResponse;
OLOG(info) << "Transition response: " << response->state << " ok: " << response->ok;
OLOG(detail) << "Transition response: " << response->state << " ok: " << response->ok;

return grpc::Status::OK;
}
Expand Down
6 changes: 3 additions & 3 deletions occ/plugin/litestructs/JsonMessage.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ bool OccLite::nopb::JsonMessage::Deserialize(::grpc::ByteBuffer* byte_buffer)
auto status = byte_buffer->Dump(slices);

if (!status.ok()) {
OLOG(info) << "Cannot dump JsonMessage slices, error code " << status.error_code() << " " << status.error_message() << " " << status.error_details();
OLOG(error) << "Cannot dump JsonMessage slices, error code " << status.error_code() << " " << status.error_message() << " " << status.error_details();
return false;
}

Expand All @@ -74,15 +74,15 @@ bool OccLite::nopb::JsonMessage::Deserialize(::grpc::ByteBuffer* byte_buffer)
::grpc::g_core_codegen_interface->grpc_slice_unref(rawSlice);
}

OLOG(info) << "Deserialized JsonMessage: " << ss.str();
OLOG(detail) << "Deserialized JsonMessage: " << ss.str();

return Deserialize(ss.str());
}

::grpc::ByteBuffer* OccLite::nopb::JsonMessage::SerializeToByteBuffer() const
{
std::string str = Serialize();
OLOG(info) << "Serialized JsonMessage: " << str;
OLOG(detail) << "Serialized JsonMessage: " << str;

// grpc::string = std::string
// We build a Slice(grpc::string) and we add it to the ByteBuffer
Expand Down
2 changes: 1 addition & 1 deletion occ/plugin/litestructs/Transition.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ bool OccLite::nopb::TransitionRequest::Deserialize(const rapidjson::Value& obj)
arguments.push_back(*ce);
}
}
OLOG(info) << "Deserialized TransitionRequest: " << JsonMessage::Serialize();
OLOG(detail) << "Deserialized TransitionRequest: " << JsonMessage::Serialize();

return true;
}
Expand Down

0 comments on commit 81c8fab

Please sign in to comment.