libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
luslog.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdint.h>
4#include "ship/Api.h"
5
6// NOLINTBEGIN(readability-identifier-naming)
7
19API_EXPORT void luslog(const char* file, int32_t line, int32_t logLevel, const char* msg);
20
33API_EXPORT void lusprintf(const char* file, int32_t line, int32_t logLevel, const char* fmt, ...);
34
35// NOLINTEND(readability-identifier-naming)
36
38#define LUSLOG_LEVEL_TRACE 0
40#define LUSLOG_LEVEL_DEBUG 1
42#define LUSLOG_LEVEL_INFO 2
44#define LUSLOG_LEVEL_WARN 3
46#define LUSLOG_LEVEL_ERROR 4
48#define LUSLOG_LEVEL_CRITICAL 5
50#define LUSLOG_LEVEL_OFF 6
51
53#define LUSLOG(level, msg, ...) lusprintf(__FILE__, __LINE__, level, msg, ##__VA_ARGS__)
55#define LUSLOG_TRACE(msg, ...) LUSLOG(LUSLOG_LEVEL_TRACE, msg, ##__VA_ARGS__)
57#define LUSLOG_DEBUG(msg, ...) LUSLOG(LUSLOG_LEVEL_DEBUG, msg, ##__VA_ARGS__)
59#define LUSLOG_INFO(msg, ...) LUSLOG(LUSLOG_LEVEL_INFO, msg, ##__VA_ARGS__)
61#define LUSLOG_WARN(msg, ...) LUSLOG(LUSLOG_LEVEL_WARN, msg, ##__VA_ARGS__)
63#define LUSLOG_ERROR(msg, ...) LUSLOG(LUSLOG_LEVEL_ERROR, msg, ##__VA_ARGS__)
65#define LUSLOG_CRITICAL(msg, ...) LUSLOG(LUSLOG_LEVEL_CRITICAL, msg, ##__VA_ARGS__)
API export/import macros for cross-platform shared library symbol visibility.
#define API_EXPORT
Marks a symbol for export from (or import into) a shared library.
Definition Api.h:32
API_EXPORT void lusprintf(const char *file, int32_t line, int32_t logLevel, const char *fmt,...)
Formats and writes a message to the Ship log at the given level.
API_EXPORT void luslog(const char *file, int32_t line, int32_t logLevel, const char *msg)
Writes a plain message to the Ship log at the given level.