Log Class

Description

Log class.

It is used to output log or setup a custom log output function.

logMessage

Outputs a log.

C

void easyar_Log_logMessage(easyar_LogLevel level, easyar_String * message)

C++

static void logMessage(LogLevel level, std::string message)

Java

public static void logMessage(int level, java.lang.@Nonnull String message)

Kotlin

companion object fun logMessage(level: Int, message: String): Unit

Objective-C

+ (void)logMessage:(easyar_LogLevel)level message:(NSString *)message

Swift

public static func logMessage(_ level: LogLevel, _ message: String) -> Void

C#

public static void logMessage(LogLevel level, string message)

setLogFunc

Sets custom log output function. The log output function should be thread-safe.

C

void easyar_Log_setLogFunc(easyar_FunctorOfVoidFromLogLevelAndString func)

C++

static void setLogFunc(std::function<void(LogLevel, std::string)> func)

Java

public static void setLogFunc(@Nonnull FunctorOfVoidFromLogLevelAndString func)

Kotlin

companion object fun setLogFunc(func: FunctorOfVoidFromLogLevelAndString): Unit

Objective-C

+ (void)setLogFunc:(void (^)(easyar_LogLevel level, NSString * message))func

Swift

public static func setLogFunc(_ `func`: @escaping (LogLevel, String) -> Void) -> Void

C#

public static void setLogFunc(Action<LogLevel, string> func)

setLogFuncWithScheduler

Sets custom log output function and run it in scheduler.

C

void easyar_Log_setLogFuncWithScheduler(easyar_CallbackScheduler * scheduler, easyar_FunctorOfVoidFromLogLevelAndString func)

C++

static void setLogFuncWithScheduler(std::shared_ptr<CallbackScheduler> scheduler, std::function<void(LogLevel, std::string)> func)

Java

public static void setLogFuncWithScheduler(@Nonnull CallbackScheduler scheduler, @Nonnull FunctorOfVoidFromLogLevelAndString func)

Kotlin

companion object fun setLogFuncWithScheduler(scheduler: CallbackScheduler, func: FunctorOfVoidFromLogLevelAndString): Unit

Objective-C

+ (void)setLogFuncWithScheduler:(easyar_CallbackScheduler *)scheduler func:(void (^)(easyar_LogLevel level, NSString * message))func

Swift

public static func setLogFuncWithScheduler(_ scheduler: CallbackScheduler, _ `func`: @escaping (LogLevel, String) -> Void) -> Void

C#

public static void setLogFuncWithScheduler(CallbackScheduler scheduler, Action<LogLevel, string> func)

resetLogFunc

Clears custom log output function and reverts to default log output function.

C

void easyar_Log_resetLogFunc(void)

C++

static void resetLogFunc()

Java

public static void resetLogFunc()

Kotlin

companion object fun resetLogFunc(): Unit

Objective-C

+ (void)resetLogFunc

Swift

public static func resetLogFunc() -> Void

C#

public static void resetLogFunc()