ログ
Wailsでは、GoまたはJavaScriptから呼び出すことのできるロギングメカニズムを用意しています。 一般的なロガーと同じように、ログにはいくつかのログレベルがあります:
- Trace
- Debug
- Info
- Warning
- Error
- Fatal
ロガーは、設定されている出力ログレベル以上のログメッセージを出力します。 例えば、出力ログレベルをDebugに設定した場合、Trace以外のすべてのレベルのメッセージが出力されます。
LogPrint
指定されたメッセージをRawメッセージとしてロギングします。
Go: LogPrint(ctx context.Context, message string)
JS: LogPrint(message: string)
LogPrintf
指定されたメッセージをRawメッセージとしてロギングします。
Go: LogPrintf(ctx context.Context, format string, args ...interface{})
LogTrace
指定されたメッセージをTraceログレベルでロギングします。
Go: LogTrace(ctx context.Context, message string)
JS: LogTrace(message: string)
LogTracef
指定されたメッセージをTraceログレベルでロギングします。
Go: LogTracef(ctx context.Context, format string, args ...interface{})
LogDebug
指定されたメッセージをDebugログレベルでロギングします。
Go: LogDebug(ctx context.Context, message string)
JS: LogDebug(message: string)
LogDebugf
指定されたメッセージをDebugログレベルでロギングします。
Go: LogDebugf(ctx context.Context, format string, args ...interface{})
LogInfo
指定されたメッセージをInfoログレベルでロギングします。
Go: LogInfo(ctx context.Context, message string)
JS: LogInfo(message: string)
LogInfof
指定されたメッセージをInfoログレベルでロギングします。
Go: LogInfof(ctx context.Context, format string, args ...interface{})
LogWarning
指定されたメッセージをWarningログレベルでロギングします。
Go: LogWarning(ctx context.Context, message string)
JS: LogWarning(message: string)