libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
luslog.h File Reference
#include <stdint.h>
#include "ship/Api.h"
Include dependency graph for luslog.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LUSLOG_LEVEL_TRACE   0
 Log level constant: emit all messages, including the most verbose trace output.
 
#define LUSLOG_LEVEL_DEBUG   1
 Log level constant: verbose debug output useful during development.
 
#define LUSLOG_LEVEL_INFO   2
 Log level constant: informational messages about normal operation.
 
#define LUSLOG_LEVEL_WARN   3
 Log level constant: warnings about unexpected but recoverable conditions.
 
#define LUSLOG_LEVEL_ERROR   4
 Log level constant: errors that indicate a failure in the current operation.
 
#define LUSLOG_LEVEL_CRITICAL   5
 Log level constant: critical failures that may cause the application to terminate.
 
#define LUSLOG_LEVEL_OFF   6
 Log level constant: disable all logging output.
 
#define LUSLOG(level, msg, ...)   lusprintf(__FILE__, __LINE__, level, msg, ##__VA_ARGS__)
 Writes a formatted log message at an explicit level.
 
#define LUSLOG_TRACE(msg, ...)   LUSLOG(LUSLOG_LEVEL_TRACE, msg, ##__VA_ARGS__)
 Writes a formatted log message at TRACE level.
 
#define LUSLOG_DEBUG(msg, ...)   LUSLOG(LUSLOG_LEVEL_DEBUG, msg, ##__VA_ARGS__)
 Writes a formatted log message at DEBUG level.
 
#define LUSLOG_INFO(msg, ...)   LUSLOG(LUSLOG_LEVEL_INFO, msg, ##__VA_ARGS__)
 Writes a formatted log message at INFO level.
 
#define LUSLOG_WARN(msg, ...)   LUSLOG(LUSLOG_LEVEL_WARN, msg, ##__VA_ARGS__)
 Writes a formatted log message at WARN level.
 
#define LUSLOG_ERROR(msg, ...)   LUSLOG(LUSLOG_LEVEL_ERROR, msg, ##__VA_ARGS__)
 Writes a formatted log message at ERROR level.
 
#define LUSLOG_CRITICAL(msg, ...)   LUSLOG(LUSLOG_LEVEL_CRITICAL, msg, ##__VA_ARGS__)
 Writes a formatted log message at CRITICAL level.
 

Functions

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.
 
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.
 

Macro Definition Documentation

◆ LUSLOG

#define LUSLOG (   level,
  msg,
  ... 
)    lusprintf(__FILE__, __LINE__, level, msg, ##__VA_ARGS__)

Writes a formatted log message at an explicit level.

◆ LUSLOG_CRITICAL

#define LUSLOG_CRITICAL (   msg,
  ... 
)    LUSLOG(LUSLOG_LEVEL_CRITICAL, msg, ##__VA_ARGS__)

Writes a formatted log message at CRITICAL level.

◆ LUSLOG_DEBUG

#define LUSLOG_DEBUG (   msg,
  ... 
)    LUSLOG(LUSLOG_LEVEL_DEBUG, msg, ##__VA_ARGS__)

Writes a formatted log message at DEBUG level.

◆ LUSLOG_ERROR

#define LUSLOG_ERROR (   msg,
  ... 
)    LUSLOG(LUSLOG_LEVEL_ERROR, msg, ##__VA_ARGS__)

Writes a formatted log message at ERROR level.

◆ LUSLOG_INFO

#define LUSLOG_INFO (   msg,
  ... 
)    LUSLOG(LUSLOG_LEVEL_INFO, msg, ##__VA_ARGS__)

Writes a formatted log message at INFO level.

◆ LUSLOG_LEVEL_CRITICAL

#define LUSLOG_LEVEL_CRITICAL   5

Log level constant: critical failures that may cause the application to terminate.

◆ LUSLOG_LEVEL_DEBUG

#define LUSLOG_LEVEL_DEBUG   1

Log level constant: verbose debug output useful during development.

◆ LUSLOG_LEVEL_ERROR

#define LUSLOG_LEVEL_ERROR   4

Log level constant: errors that indicate a failure in the current operation.

◆ LUSLOG_LEVEL_INFO

#define LUSLOG_LEVEL_INFO   2

Log level constant: informational messages about normal operation.

◆ LUSLOG_LEVEL_OFF

#define LUSLOG_LEVEL_OFF   6

Log level constant: disable all logging output.

◆ LUSLOG_LEVEL_TRACE

#define LUSLOG_LEVEL_TRACE   0

Log level constant: emit all messages, including the most verbose trace output.

◆ LUSLOG_LEVEL_WARN

#define LUSLOG_LEVEL_WARN   3

Log level constant: warnings about unexpected but recoverable conditions.

◆ LUSLOG_TRACE

#define LUSLOG_TRACE (   msg,
  ... 
)    LUSLOG(LUSLOG_LEVEL_TRACE, msg, ##__VA_ARGS__)

Writes a formatted log message at TRACE level.

◆ LUSLOG_WARN

#define LUSLOG_WARN (   msg,
  ... 
)    LUSLOG(LUSLOG_LEVEL_WARN, msg, ##__VA_ARGS__)

Writes a formatted log message at WARN level.

Function Documentation

◆ luslog()

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.

This is the low-level logging function. Prefer the LUSLOG_* convenience macros which automatically capture __FILE__ and __LINE__.

Parameters
fileSource file name (typically __FILE__).
lineSource line number (typically __LINE__).
logLevelSeverity level (one of the LUSLOG_LEVEL_* constants).
msgNull-terminated message string.

◆ lusprintf()

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.

Prefer the LUSLOG_* convenience macros which automatically capture __FILE__ and __LINE__.

Parameters
fileSource file name (typically __FILE__).
lineSource line number (typically __LINE__).
logLevelSeverity level (one of the LUSLOG_LEVEL_* constants).
fmtprintf-style format string.
...Format arguments.