Tesseract 0.28.4
Loading...
Searching...
No Matches
logging.cpp File Reference

Structured logging extensions for spdlog. More...

#include <tesseract/common/logging.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/spdlog.h>
#include <algorithm>
#include <atomic>
#include <condition_variable>
#include <mutex>
#include <stdexcept>
#include <type_traits>
#include <unordered_map>
#include <utility>
#include <vector>

Namespaces

namespace  tesseract::common
 Namespace owning boost's hash_is_avalanching, and defined iff boost has the trait at all.
 

Functions

std::shared_ptr< spdlog::logger > tesseract::common::getLogger (std::string_view name="tesseract")
 Get the Tesseract-owned default logger or a registered named logger.
 
void tesseract::common::setLogger (std::shared_ptr< spdlog::logger > logger)
 Replace the default Tesseract logger.
 
bool tesseract::common::isLogLevelEnabled (spdlog::level::level_enum level) noexcept
 Check whether the default Tesseract logger accepts a severity.
 
LogRecordHandlerId tesseract::common::addLogRecordHandler (LogRecordHandler handler)
 Register a callback that receives structured log records.
 
bool tesseract::common::removeLogRecordHandler (LogRecordHandlerId id) noexcept
 Unregister a structured-record callback.
 
spdlog::logger * tesseract::common::detail::getDefaultLogger () noexcept
 Get the default logger through the lock-free logging path.
 
void tesseract::common::detail::emitLogRecord (spdlog::logger &logger, const LogRecord &record) noexcept
 Emit a record through an already-resolved logger.
 
void tesseract::common::emitLogRecord (const LogRecord &record) noexcept
 Emit a structured record through its spdlog logger and all registered handlers.
 

Detailed Description

Structured logging extensions for spdlog.

Author
Levi Armstrong
Date
September 24, 2026
License
Software License Agreement (Apache License)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.