Skip to content

Commit

Permalink
remove redundant namespace prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
odygrd committed Sep 25, 2024
1 parent ed55b17 commit 6acb4b7
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 45 deletions.
5 changes: 3 additions & 2 deletions include/quill/Backend.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @page copyright
* @page copyright
* Copyright(c) 2020-present, Odysseas Georgoudis & quill contributors.* @page copyright
* Distributed under the MIT License (http://opensource.org/licenses/MIT)
*/
Expand Down Expand Up @@ -220,7 +220,8 @@ class Backend

if (!manual_backend_worker)
{
QUILL_THROW(QuillError{"acquire_manual_backend_worker() can only be called once per process. "
QUILL_THROW(
QuillError{"acquire_manual_backend_worker() can only be called once per process. "
"Additionally, it should "
"not be called when start() or start_with_signal_handler() has been invoked"});
}
Expand Down
25 changes: 12 additions & 13 deletions include/quill/CsvWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ class CsvWriter
cfg.set_filename_append_option(filename_append);
return cfg;
}()),
quill::PatternFormatterOptions{"%(message)", "", Timezone::GmtTime});
PatternFormatterOptions{"%(message)", "", Timezone::GmtTime});

_logger->template log_statement<false, false>(quill::LogLevel::None, &header_metadata, TCsvSchema::header);
_logger->template log_statement<false, false>(LogLevel::None, &header_metadata, TCsvSchema::header);
}

/**
Expand All @@ -74,11 +74,10 @@ class CsvWriter
*/
CsvWriter(std::string const& unique_name, std::shared_ptr<Sink> sink)
{
_logger =
Frontend::create_or_get_logger(unique_name + "_csv", std::move(sink),
quill::PatternFormatterOptions{"%(message)", "", Timezone::GmtTime});
_logger = Frontend::create_or_get_logger(unique_name + "_csv", std::move(sink),
PatternFormatterOptions{"%(message)", "", Timezone::GmtTime});

_logger->template log_statement<false, false>(quill::LogLevel::None, &header_metadata, TCsvSchema::header);
_logger->template log_statement<false, false>(LogLevel::None, &header_metadata, TCsvSchema::header);
}

/**
Expand All @@ -90,9 +89,9 @@ class CsvWriter
CsvWriter(std::string const& unique_name, std::initializer_list<std::shared_ptr<Sink>> sinks)
{
_logger = Frontend::create_or_get_logger(
unique_name + "_csv", sinks, quill::PatternFormatterOptions{"%(message)", "", Timezone::GmtTime});
unique_name + "_csv", sinks, PatternFormatterOptions{"%(message)", "", Timezone::GmtTime});

_logger->template log_statement<false, false>(quill::LogLevel::None, &header_metadata, TCsvSchema::header);
_logger->template log_statement<false, false>(LogLevel::None, &header_metadata, TCsvSchema::header);
}

/**
Expand All @@ -112,7 +111,7 @@ class CsvWriter
template <typename... Args>
void append_row(Args&&... fields)
{
_logger->template log_statement<false, false>(quill::LogLevel::None, &line_metadata, fields...);
_logger->template log_statement<false, false>(LogLevel::None, &line_metadata, fields...);
}

/**
Expand All @@ -122,11 +121,11 @@ class CsvWriter
void flush() { _logger->flush_log(); }

private:
static constexpr quill::MacroMetadata header_metadata{
"", "", "{}", nullptr, LogLevel::Info, quill::MacroMetadata::Event::Log};
static constexpr MacroMetadata header_metadata{
"", "", "{}", nullptr, LogLevel::Info, MacroMetadata::Event::Log};

static constexpr quill::MacroMetadata line_metadata{
"", "", TCsvSchema::format, nullptr, LogLevel::Info, quill::MacroMetadata::Event::Log};
static constexpr MacroMetadata line_metadata{
"", "", TCsvSchema::format, nullptr, LogLevel::Info, MacroMetadata::Event::Log};

LoggerImpl<TFrontendOptions>* _logger{nullptr};
};
Expand Down
14 changes: 7 additions & 7 deletions include/quill/Logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,22 @@ class LoggerImpl : public detail::LoggerBase
#ifndef NDEBUG
if (has_dynamic_log_level)
{
assert((dynamic_log_level != quill::LogLevel::None) &&
assert((dynamic_log_level != LogLevel::None) &&
"When has_dynamic_log_level is set to true then dynamic_log_level should not be None");
}

if (dynamic_log_level != quill::LogLevel::None)
if (dynamic_log_level != LogLevel::None)
{
assert((macro_metadata->log_level() == quill::LogLevel::Dynamic) &&
assert((macro_metadata->log_level() == LogLevel::Dynamic) &&
"MacroMetadata LogLevel must be Dynamic when using a dynamic_log_level");

assert(has_dynamic_log_level &&
"When dynamic_log_level is used then has_dynamic_log_level must also be true");
}

if (macro_metadata->log_level() != quill::LogLevel::Dynamic)
if (macro_metadata->log_level() != LogLevel::Dynamic)
{
assert((dynamic_log_level == quill::LogLevel::None) &&
assert((dynamic_log_level == LogLevel::None) &&
"No dynamic_log_level should be set when MacroMetadata LogLevel is not Dynamic");
}

Expand Down Expand Up @@ -224,7 +224,7 @@ class LoggerImpl : public detail::LoggerBase
*/
void init_backtrace(uint32_t max_capacity, LogLevel flush_level = LogLevel::None)
{
// we do not care about the other fields, except quill::MacroMetadata::Event::InitBacktrace
// we do not care about the other fields, except MacroMetadata::Event::InitBacktrace
static constexpr MacroMetadata macro_metadata{
"", "", "{}", nullptr, LogLevel::Critical, MacroMetadata::Event::InitBacktrace};

Expand All @@ -244,7 +244,7 @@ class LoggerImpl : public detail::LoggerBase
*/
void flush_backtrace()
{
// we do not care about the other fields, except quill::MacroMetadata::Event::Flush
// we do not care about the other fields, except MacroMetadata::Event::Flush
static constexpr MacroMetadata macro_metadata{
"", "", "", nullptr, LogLevel::Critical, MacroMetadata::Event::FlushBacktrace};

Expand Down
6 changes: 3 additions & 3 deletions include/quill/StringRef.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ class StringRef

/***/
template <>
struct Codec<quill::utility::StringRef>
struct Codec<utility::StringRef>
{
static size_t compute_encoded_size(detail::SizeCacheVector&, quill::utility::StringRef const&) noexcept
static size_t compute_encoded_size(detail::SizeCacheVector&, utility::StringRef const&) noexcept
{
return sizeof(size_t) + sizeof(uintptr_t);
}

static void encode(std::byte*& buffer, detail::SizeCacheVector const&, uint32_t&,
quill::utility::StringRef const& no_copy) noexcept
utility::StringRef const& no_copy) noexcept
{
char const* data = no_copy.get_string_view().data();
std::memcpy(buffer, &data, sizeof(uintptr_t));
Expand Down
4 changes: 2 additions & 2 deletions include/quill/backend/BackendManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class BackendManager
BackendManager& operator=(BackendManager const&) = delete;

private:
friend class quill::Backend;
friend class quill::BackendTscClock;
friend class Backend;
friend class BackendTscClock;

/***/
BackendManager() = default;
Expand Down
4 changes: 2 additions & 2 deletions include/quill/backend/BackendWorker.h
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ class BackendWorker
{
transit_event->named_args->clear();
}

thread_context->_transit_event_buffer->pop_front();

if (flush_flag)
Expand Down Expand Up @@ -1498,7 +1498,7 @@ class BackendWorker
}

private:
friend class quill::ManualBackendWorker;
friend class ManualBackendWorker;

ThreadContextManager& _thread_context_manager = ThreadContextManager::instance();
SinkManager& _sink_manager = SinkManager::instance();
Expand Down
10 changes: 5 additions & 5 deletions include/quill/backend/SignalHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ void on_signal(int32_t signal_number)
#endif

auto logger = reinterpret_cast<LoggerImpl<TFrontendOptions>*>(logger_base);
QUILL_SIGNAL_HANDLER_LOG(logger, quill::LogLevel::Info, "Received signal: {} (signum: {})",
QUILL_SIGNAL_HANDLER_LOG(logger, LogLevel::Info, "Received signal: {} (signum: {})",
signal_desc, signal_number);

if (signal_number == SIGINT || signal_number == SIGTERM)
Expand All @@ -163,7 +163,7 @@ void on_signal(int32_t signal_number)

if (should_reraise_signal)
{
QUILL_SIGNAL_HANDLER_LOG(logger, quill::LogLevel::Critical,
QUILL_SIGNAL_HANDLER_LOG(logger, LogLevel::Critical,
"Program terminated unexpectedly due to signal: {} (signum: {})",
signal_desc, signal_number);

Expand Down Expand Up @@ -256,7 +256,7 @@ BOOL WINAPI on_console_signal(DWORD signal)
if (logger_base)
{
auto logger = reinterpret_cast<LoggerImpl<TFrontendOptions>*>(logger_base);
QUILL_SIGNAL_HANDLER_LOG(logger, quill::LogLevel::Info,
QUILL_SIGNAL_HANDLER_LOG(logger, LogLevel::Info,
"Program interrupted by Ctrl+C or Ctrl+Break signal");

// Pass `0` to avoid calling std::this_thread::sleep_for()
Expand Down Expand Up @@ -285,11 +285,11 @@ LONG WINAPI on_exception(EXCEPTION_POINTERS* exception_p)
{
auto logger = reinterpret_cast<LoggerImpl<TFrontendOptions>*>(logger_base);

QUILL_SIGNAL_HANDLER_LOG(logger, quill::LogLevel::Info, "Received exception: {} (Code: {})",
QUILL_SIGNAL_HANDLER_LOG(logger, LogLevel::Info, "Received exception: {} (Code: {})",
get_error_message(exception_p->ExceptionRecord->ExceptionCode),
exception_p->ExceptionRecord->ExceptionCode);

QUILL_SIGNAL_HANDLER_LOG(logger, quill::LogLevel::Critical,
QUILL_SIGNAL_HANDLER_LOG(logger, LogLevel::Critical,
"Program terminated unexpectedly due to exception: {} (Code: {})",
get_error_message(exception_p->ExceptionRecord->ExceptionCode),
exception_p->ExceptionRecord->ExceptionCode);
Expand Down
2 changes: 1 addition & 1 deletion include/quill/core/FrontendOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct FrontendOptions
*
* By default, the library uses an UnboundedBlocking queue, which starts with initial_queue_capacity.
*/
static constexpr quill::QueueType queue_type = quill::QueueType::UnboundedBlocking;
static constexpr QueueType queue_type = QueueType::UnboundedBlocking;

/**
* Initial capacity of the queue. Used for UnboundedBlocking, UnboundedDropping, and
Expand Down
4 changes: 2 additions & 2 deletions include/quill/core/UnboundedSPSCQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class UnboundedSPSCQueue
* making it visible to the consumer.
* @return a valid point to the buffer
*/
template <quill::QueueType queue_type>
template <QueueType queue_type>
QUILL_NODISCARD QUILL_ATTRIBUTE_HOT std::byte* prepare_write(size_t nbytes)
{
// Try to reserve the bounded queue
Expand Down Expand Up @@ -200,7 +200,7 @@ class UnboundedSPSCQueue

private:
/***/
template <quill::QueueType queue_type>
template <QueueType queue_type>
QUILL_NODISCARD std::byte* _handle_full_queue(size_t nbytes)
{
// Then it means the queue doesn't have enough size
Expand Down
16 changes: 8 additions & 8 deletions include/quill/sinks/FileSink.h
Original file line number Diff line number Diff line change
Expand Up @@ -432,24 +432,24 @@ class FileSink : public StreamSink
* @param time_zone Timezone to use.
* @return Updated filename.
*/
QUILL_NODISCARD static quill::fs::path _get_updated_filename_with_appended_datetime(
quill::fs::path const& filename, quill::FilenameAppendOption append_to_filename_option,
std::string const& append_filename_format_pattern, quill::Timezone time_zone,
QUILL_NODISCARD static fs::path _get_updated_filename_with_appended_datetime(
fs::path const& filename, FilenameAppendOption append_to_filename_option,
std::string const& append_filename_format_pattern, Timezone time_zone,
std::chrono::system_clock::time_point timestamp)
{
if ((append_to_filename_option == quill::FilenameAppendOption::None) || (filename == "/dev/null"))
if ((append_to_filename_option == FilenameAppendOption::None) || (filename == "/dev/null"))
{
return filename;
}

if ((append_to_filename_option == quill::FilenameAppendOption::StartCustomTimestampFormat) ||
(append_to_filename_option == quill::FilenameAppendOption::StartDate) ||
(append_to_filename_option == quill::FilenameAppendOption::StartDateTime))
if ((append_to_filename_option == FilenameAppendOption::StartCustomTimestampFormat) ||
(append_to_filename_option == FilenameAppendOption::StartDate) ||
(append_to_filename_option == FilenameAppendOption::StartDateTime))
{
return append_datetime_to_filename(filename, append_filename_format_pattern, time_zone, timestamp);
}

return quill::fs::path{};
return fs::path{};
}

private:
Expand Down

0 comments on commit 6acb4b7

Please sign in to comment.