libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
Logger.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <string>
5#include <spdlog/logger.h>
7
8namespace Ship {
9
23class Logger : public Component {
24 public:
35 Logger(const std::string& appName, const std::string& logFilePath);
36 ~Logger() override;
37
42 std::shared_ptr<spdlog::logger> Get() const;
43
44 protected:
45 void OnInit(const nlohmann::json& initArgs) override;
46
47 private:
48 std::string mAppName;
49 std::string mLogFilePath;
50 std::shared_ptr<spdlog::logger> mLogger;
51};
52
53} // namespace Ship
A named Part with a parent/child hierarchy and optional thread safety.
Definition Component.h:34
Component wrapper around an spdlog::logger instance.
Definition Logger.h:23
std::shared_ptr< spdlog::logger > Get() const
Returns the underlying spdlog logger, or nullptr before Init().
Logger(const std::string &appName, const std::string &logFilePath)
Constructs a Logger with the given application name and log file path.
void OnInit(const nlohmann::json &initArgs) override
Override this to implement component-specific initialization logic.
~Logger() override
Core namespace for the libultraship engine framework.
Definition gfx_direct3d_common.h:14