Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions score/kvs/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ cc_library(
"error.cpp",
"internal/kvs_helper.cpp",
"internal/kvs_helper.hpp",
"internal/logger.h",
"kvs.cpp",
"kvsbuilder.cpp",
"kvsvalue.cpp",
Expand Down
34 changes: 34 additions & 0 deletions score/kvs/internal/logger.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/********************************************************************************
* Copyright (c) 2025 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
#ifndef SCORE_KVS_INTERNAL_LOGGER_H
#define SCORE_KVS_INTERNAL_LOGGER_H

#include "score/mw/log/logger.h"
#include <string_view>

namespace score::mw::per::kvs
{

/// @brief Log context of KVS.
constexpr std::string_view kLogContext{"SKVS"};

/// @brief Returns the logger shared by all KVS instances.
inline const score::mw::log::Logger& logger() noexcept
{
static const score::mw::log::Logger instance{kLogContext};
return instance;
}

} // namespace score::mw::per::kvs

#endif // SCORE_KVS_INTERNAL_LOGGER_H
Loading
Loading