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

Contains basic logging functionality. More...

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

Go to the source code of this file.

Enumerations

enum  kinc_log_level_t { KINC_LOG_LEVEL_INFO , KINC_LOG_LEVEL_WARNING , KINC_LOG_LEVEL_ERROR }
 Pass this to kinc_log or kinc_log_args. More...

Functions

KINC_FUNC void kinc_log (kinc_log_level_t log_level, const char *format,...)
 Logging function similar to printf including some system-specific bonuses.
KINC_FUNC void kinc_log_args (kinc_log_level_t log_level, const char *format, va_list args)
 Equivalent to kinc_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

◆ kinc_log_level_t

Pass this to kinc_log or kinc_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

◆ kinc_log()

KINC_FUNC void kinc_log ( kinc_log_level_t 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.

◆ kinc_log_args()

KINC_FUNC void kinc_log_args ( kinc_log_level_t log_level,
const char * format,
va_list args )

Equivalent to kinc_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.