maix::log

maix.log module

This is maix::log module of MaixCDK.
All of these elements are in namespace maix::log.

For MaixCDK developer: DO NOT edit this doc file manually, this doc is auto generated!

Module

No module

Enum

LogLevel

Error log level enums

item describe
values LEVEL_NONE:
LEVEL_ERROR:
LEVEL_WARN:
LEVEL_INFO:
LEVEL_DEBUG:
LEVEL_MAX:

C++ defination code:

enum class LogLevel
    {
        LEVEL_NONE  = 0,
        LEVEL_ERROR,
        LEVEL_WARN,
        LEVEL_INFO,
        LEVEL_DEBUG,
        LEVEL_MAX
    }

Variable

Function

set_log_level

Set log level globally, by default log level is LEVEL_INFO.

item description
param level: log level, @see maix.log.LogLevel
color: true to enable color, false to disable color

C++ defination code:

void set_log_level(log::LogLevel level, bool color)

get_log_level

Get current log level

item description
return current log level

C++ defination code:

log::LogLevel get_log_level()

get_log_use_color

Get whether log use color

item description
return true if log use color, else false

C++ defination code:

bool get_log_use_color()

error

print error log

item description
param fmt: format string
...: args

C++ defination code:

void error(const char *fmt, ...)

warn

print warning log

item description
param fmt: format string
...: args

C++ defination code:

void warn(const char *fmt, ...)

info

print info log

item description
param fmt: format string
...: args

C++ defination code:

void info(const char *fmt, ...)

debug

print debug log

item description
param fmt: format string
...: args

C++ defination code:

void debug(const char *fmt, ...)

error0

print error log, but not add '\n' at end

item description
param fmt: format string
...: args

C++ defination code:

void error0(const char *fmt, ...)

warn0

print warning log, but not add '\n' at end

item description
param fmt: format string
...: args

C++ defination code:

void warn0(const char *fmt, ...)

info0

print info log, but not add '\n' at end

item description
param fmt: format string
...: args

C++ defination code:

void info0(const char *fmt, ...)

debug0

print debug log, but not add '\n' at end

item description
param fmt: format string
...: args

C++ defination code:

void debug0(const char *fmt, ...)

print

DEPRACATED, DO NOT USE THIS method.\nsame as printf, but recommend use this function instead of printf\nthis function will add prefix like "-- [E] " to log

item description
param fmt: format string
...: args

C++ defination code:

void print(const char *fmt, ...)

print (overload 1)

print log info with specified log level, no '\n' at end and no prefix like "-- [E] ".\nthis function will add prefix like "-- [E] " to log

item description
param fmt: format string
...: args

C++ defination code:

void print(log::LogLevel level, const char *fmt, ...)

flush

flush log

item description
param level: log level, @see maix.log.LogLevel

C++ defination code:

void flush(log::LogLevel level = log::LogLevel::LEVEL_NONE)

Class