Entire-Metadata: .entire/metadata/fb87247f-2a75-407e-b336-cbc8c20ba5a6 Entire-Session: fb87247f-2a75-407e-b336-cbc8c20ba5a6 Entire-Strategy: manual-commit
74 lines
1.9 KiB
C++
74 lines
1.9 KiB
C++
/*
|
|
(c) Copyright, Real-Time Innovations, 2017-
|
|
All rights reserved.
|
|
|
|
No duplications, whole or partial, manual or electronic, may be made without
|
|
express written permission. Any such copies, or revisions thereof, must
|
|
display this notice unaltered.
|
|
|
|
This code contains trade secrets of Real-Time Innovations, Inc.
|
|
*/
|
|
|
|
#ifndef HPP_ROUTING_LOG_LOG_CONFIG_HPP_
|
|
#define HPP_ROUTING_LOG_LOG_CONFIG_HPP_
|
|
|
|
#include <cstdio>
|
|
#include <cstdarg>
|
|
|
|
#include "log/log_common.h"
|
|
#include "routingservice/routingservice_log.h"
|
|
|
|
#include "ndds/ndds_config_c.h"
|
|
|
|
|
|
namespace rti { namespace routing { namespace log {
|
|
|
|
class LogConfig {
|
|
public:
|
|
static rti::routing::log::LogConfig& instance()
|
|
{
|
|
static rti::routing::log::LogConfig singleton;
|
|
return singleton;
|
|
}
|
|
|
|
// Deleted constructor to avoid multiple instances.
|
|
LogConfig(const LogConfig&) = delete;
|
|
LogConfig(LogConfig&&) = delete;
|
|
|
|
RTILogBitmap instrumentation_mask() const
|
|
{
|
|
NDDS_Config_LogVerbosity verbosity =
|
|
NDDS_Config_Logger_get_verbosity_by_service(
|
|
NDDS_Config_Logger_get_instance(),
|
|
NDDS_CONFIG_LOG_SERVICE_ROUTING);
|
|
return (RTILogBitmap) verbosity;
|
|
}
|
|
|
|
LogConfig& instrumentation_mask(RTILogBitmap logmask)
|
|
{
|
|
NDDS_Config_Logger_set_verbosity_by_service(
|
|
NDDS_Config_Logger_get_instance(),
|
|
NDDS_CONFIG_LOG_SERVICE_ROUTING,
|
|
(NDDS_Config_LogVerbosity) logmask);
|
|
return *this;
|
|
}
|
|
|
|
void router_instrumentation_mask(RTILogBitmap logmask)
|
|
{
|
|
instrumentation_mask(logmask);
|
|
}
|
|
|
|
void update_native(RTILogBitmap logmask)
|
|
{
|
|
router_instrumentation_mask(logmask);
|
|
}
|
|
|
|
private:
|
|
// Constructor is private: this class is a singleton
|
|
LogConfig() = default;
|
|
};
|
|
|
|
}}} // rti::routing::log
|
|
|
|
#endif /* HPP_ROUTING_LOG_LOG_CONFIG_HPP_ */
|