Kore 3
Loading...
Searching...
No Matches
log.h File Reference

Contains basic logging functionality. More...

#include <kore3/global.h>
#include <stdarg.h>

Go to the source code of this file.

Enumerations

enum  kore_log_level { KORE_LOG_LEVEL_INFO , KORE_LOG_LEVEL_WARNING , KORE_LOG_LEVEL_ERROR }
 Pass this to kore_log or kore_log_args. More...

Functions

KORE_FUNC void kore_log (kore_log_level log_level, const char *format,...)
 Logging function similar to printf including some system-specific bonuses.
KORE_FUNC void kore_log_args (kore_log_level log_level, const char *format, va_list args)
 Equivalent to kore_log but uses a va_list parameter.

Detailed Description

Contains basic logging functionality.

Logging functionality is similar to plain printf but provides some system-specific bonuses.

Enumeration Type Documentation

◆ kore_log_level

Pass this to kore_log or kore_log_args.

When used on Android the log level is converted to the equivalent Android logging level. It is currently ignored on all other targets.

Function Documentation

◆ kore_log()

KORE_FUNC void kore_log ( kore_log_level log_level,
const char * format,
... )

Logging function similar to printf including some system-specific bonuses.

On most systems this is equivalent to printf. On Windows it works with utf-8 strings (like printf does on any other target) and also prints to the debug console in IDEs. On Android this uses the android logging functions and also passes the logging level.

Parameters
log_levelThe logLevel is ignored on all targets but Android where it is converted to the equivalent Android log level
formatThe parameter is equivalent to the first printf parameter.
...The parameter is equivalent to the second printf parameter.

◆ kore_log_args()

KORE_FUNC void kore_log_args ( kore_log_level log_level,
const char * format,
va_list args )

Equivalent to kore_log but uses a va_list parameter.

You will need this if you want to log parameters using va_start/va_end.

Parameters
log_levelThe logLevel is ignored on all targets but Android where it is converted to the equivalent Android log level
formatThe parameter is equivalent to the first vprintf parameter.
argsThe parameter is equivalent to the second vprintf parameter.