mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-26 11:22:17 -05:00
d24c8453db
subrepo: subdir: "libultraship" merged: "a484cda98" upstream: origin: "https://github.com/HarbourMasters/libultraship.git" branch: "main" commit: "a484cda98" git-subrepo: version: "0.4.1" origin: "???" commit: "???"
22 lines
683 B
C++
22 lines
683 B
C++
#include "spdlog/spdlog.h"
|
|
#include <string>
|
|
#include "luslog.h"
|
|
|
|
extern "C" {
|
|
void luslog(const char* file, int32_t line, int32_t logLevel, const char* msg) {
|
|
std::string str(msg);
|
|
spdlog::level::level_enum lvl = (spdlog::level::level_enum)logLevel;
|
|
auto loc = spdlog::source_loc{ file, line, SPDLOG_FUNCTION };
|
|
|
|
spdlog::default_logger_raw()->log(loc, lvl, str);
|
|
}
|
|
|
|
void lusprintf(const char* file, int32_t line, int32_t logLevel, const char* fmt, ...) {
|
|
va_list args;
|
|
va_start(args, fmt);
|
|
char buffer[4096];
|
|
|
|
vsnprintf(buffer, sizeof(buffer), fmt, args);
|
|
luslog(file, line, logLevel, buffer);
|
|
}
|
|
} |