Skip to content

Commit

Permalink
Attach lcf log handler
Browse files Browse the repository at this point in the history
Messages from liblcf are now saved in our logfile
  • Loading branch information
Ghabry committed Nov 22, 2024
1 parent ff90208 commit 29b92af
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/

// Headers

#include <algorithm>
#include <cstring>
#include <cstdlib>
Expand Down Expand Up @@ -81,6 +80,7 @@
#include "instrumentation.h"
#include "transition.h"
#include <lcf/scope_guard.h>
#include <lcf/log_handler.h>
#include "baseui.h"
#include "game_clock.h"
#include "message_overlay.h"
Expand Down Expand Up @@ -152,6 +152,10 @@ namespace {
}

void Player::Init(std::vector<std::string> args) {
lcf::LogHandler::SetHandler([](lcf::LogHandler::Level level, StringView message, lcf::LogHandler::UserData) {
Output::Debug("lcf ({}): {}", lcf::LogHandler::kLevelTags.tag(level), message);
});

frames = 0;

// Must be called before the first call to Output
Expand Down

0 comments on commit 29b92af

Please sign in to comment.