Fix some typos

This commit is contained in:
gabime 2024-01-13 18:53:19 +02:00
parent c539f36551
commit ce3922cff1
7 changed files with 8 additions and 9 deletions

View File

@ -37,8 +37,7 @@ struct async_factory_impl {
static std::shared_ptr<async_logger> create(std::string logger_name, SinkArgs &&...args) {
auto &registry_inst = details::registry::instance();
// create global thread pool if not already exists..
// create global thread pool if not already exists
auto &mutex = registry_inst.tp_mutex();
std::lock_guard<std::recursive_mutex> tp_lock(mutex);
auto tp = registry_inst.get_tp();

View File

@ -21,7 +21,7 @@ namespace spdlog {
// Async overflow policy - block by default.
enum class async_overflow_policy {
block, // Block until message can be enqueued
overrun_oldest, // Discard oldest message in the queue if full when trying to
overrun_oldest, // Discard the oldest message in the queue if full when trying to
// add new item.
discard_new // Discard new message if the queue is full when trying to add new item.
};

View File

@ -32,7 +32,7 @@ public:
circular_q &operator=(const circular_q &) = default;
// move cannot be default,
// since we need to reset head_, tail_, etc to zero in the moved object
// since we need to reset head_, tail_, etc. to zero in the moved object
circular_q(circular_q &&other) noexcept { copy_moveable(std::move(other)); }
circular_q &operator=(circular_q &&other) noexcept {

View File

@ -36,7 +36,7 @@ private:
void flush_() override;
#ifdef _WIN32
HANDLE handle_;
#endif // WIN32
#endif // _WIN32
};
template <typename Mutex>

View File

@ -12,7 +12,7 @@ spdlog::level level_from_str(const std::string &name) noexcept {
auto it = std::find(std::begin(level_string_views), std::end(level_string_views), name);
if (it != std::end(level_string_views)) return static_cast<level>(std::distance(std::begin(level_string_views), it));
// check also for "warn" and "err" before giving up..
// check also for "warn" and "err" before giving up
if (name == "warn") {
return spdlog::level::warn;
}

View File

@ -56,7 +56,7 @@
#include <thread.h> // for thr_self
#endif
#endif // unix
#endif // _WIN32
#if defined __APPLE__
#include <AvailabilityMacros.h>

View File

@ -40,7 +40,7 @@ stdout_sink_base<Mutex>::stdout_sink_base(FILE *file)
if (handle_ == INVALID_HANDLE_VALUE && file != stdout && file != stderr) {
throw_spdlog_ex("spdlog::stdout_sink_base: _get_osfhandle() failed", errno);
}
#endif // WIN32
#endif // _WIN32
}
template <typename Mutex>
@ -62,7 +62,7 @@ void stdout_sink_base<Mutex>::sink_it_(const details::log_msg &msg) {
memory_buf_t formatted;
base_sink<Mutex>::formatter_->format(msg, formatted);
::fwrite(formatted.data(), sizeof(char), formatted.size(), file_);
#endif // WIN32
#endif // _WIN32
::fflush(file_); // flush every line to terminal
}