Skip to content
Merged
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions src/geode/basic/file_logger_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <geode/basic/file_logger_client.hpp>

// clang-format off
#include <spdlog/spdlog.h>

Check failure on line 27 in src/geode/basic/file_logger_client.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/basic/file_logger_client.cpp:27:10 [clang-diagnostic-error]

'spdlog/spdlog.h' file not found

#include <spdlog/sinks/basic_file_sink.h>
// clang-format on
Expand All @@ -46,14 +46,19 @@
void always_flush()
{
logger_impl_->flush_on( spdlog::level::level_enum::trace );
always_flush_ = true;
}

void set_file_path( std::string_view file_path )
{
static constexpr auto logger_name = "geode_logger_file";

Check warning on line 54 in src/geode/basic/file_logger_client.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/basic/file_logger_client.cpp:54:35 [readability-identifier-naming]

invalid case style for constexpr variable 'logger_name'
spdlog::drop( logger_name );
logger_impl_ = spdlog::basic_logger_mt(
logger_name, std::string( file_path ) );
if( always_flush_ )
{
always_flush();
}
}

void trace( const std::string &message )
Expand Down Expand Up @@ -88,6 +93,7 @@

private:
std::shared_ptr< spdlog::logger > logger_impl_{ nullptr };
bool always_flush_{ false };
};

FileLoggerClient::FileLoggerClient( std::string_view file_path )
Expand Down
Loading