Class Log
- 命名空間
- easyar
日誌類。 用於輸出日誌或設定自訂日誌輸出函數。
Log
方法
logMessage
輸出日誌。
void easyar_Log_logMessage(easyar_LogLevel level, easyar_String * message)
static void logMessage(LogLevel level, std::string message)
public static void logMessage(int level, java.lang.@Nonnull String message)
companion object fun logMessage(level: Int, message: String): Unit
+ (void)logMessage:(easyar_LogLevel)level message:(NSString *)message
public static func logMessage(_ level: LogLevel, _ message: String) -> Void
public static void logMessage(LogLevel level, string message)
參數
| 名稱 | 類型 | 描述 |
|---|---|---|
| level | LogLevel | |
| message | String |
傳回值
| 類型 | 描述 |
|---|---|
| Void |
setLogFunc
設定自訂日誌輸出函數。此日誌輸出函數應保證線程安全。
void easyar_Log_setLogFunc(easyar_FunctorOfVoidFromLogLevelAndString func)
static void setLogFunc(std::function<void(LogLevel, std::string)> func)
public static void setLogFunc(@Nonnull FunctorOfVoidFromLogLevelAndString func)
companion object fun setLogFunc(func: FunctorOfVoidFromLogLevelAndString): Unit
+ (void)setLogFunc:(void (^)(easyar_LogLevel level, NSString * message))func
public static func setLogFunc(_ `func`: @escaping (LogLevel, String) -> Void) -> Void
public static void setLogFunc(Action<LogLevel, string> func)
參數
| 名稱 | 類型 | 描述 |
|---|---|---|
| func | Action<,> |
傳回值
| 類型 | 描述 |
|---|---|
| Void |
setLogFuncWithScheduler
設定自訂日誌輸出函數,並透過scheduler來指定運行時機。
void easyar_Log_setLogFuncWithScheduler(easyar_CallbackScheduler * scheduler, easyar_FunctorOfVoidFromLogLevelAndString func)
static void setLogFuncWithScheduler(std::shared_ptr<CallbackScheduler> scheduler, std::function<void(LogLevel, std::string)> func)
public static void setLogFuncWithScheduler(@Nonnull CallbackScheduler scheduler, @Nonnull FunctorOfVoidFromLogLevelAndString func)
companion object fun setLogFuncWithScheduler(scheduler: CallbackScheduler, func: FunctorOfVoidFromLogLevelAndString): Unit
+ (void)setLogFuncWithScheduler:(easyar_CallbackScheduler *)scheduler func:(void (^)(easyar_LogLevel level, NSString * message))func
public static func setLogFuncWithScheduler(_ scheduler: CallbackScheduler, _ `func`: @escaping (LogLevel, String) -> Void) -> Void
public static void setLogFuncWithScheduler(CallbackScheduler scheduler, Action<LogLevel, string> func)
參數
| 名稱 | 類型 | 描述 |
|---|---|---|
| scheduler | CallbackScheduler | |
| func | Action<,> |
傳回值
| 類型 | 描述 |
|---|---|
| Void |
resetLogFunc
清除自訂日誌輸出函數,還原成預設的日誌輸出函數。
void easyar_Log_resetLogFunc(void)
static void resetLogFunc()
public static void resetLogFunc()
companion object fun resetLogFunc(): Unit
+ (void)resetLogFunc
public static func resetLogFunc() -> Void
public static void resetLogFunc()
傳回值
| 類型 | 描述 |
|---|---|
| Void |