Class LogEvent.Builder
java.lang.Object
cloud.opencode.base.log.LogEvent.Builder
- Enclosing class:
LogEvent
Log Event Builder - Fluent Builder for LogEvent Construction
日志事件构建器 - LogEvent 的流式构建器
Provides a fluent API for building LogEvent instances with
sensible defaults for optional fields.
提供流式 API 来构建 LogEvent 实例,可选字段有合理的默认值。
- Since:
- JDK 25, opencode-base-log V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the log event.callerInfo(CallerInfo callerInfo) Sets the caller info.loggerName(String loggerName) Sets the logger name.Sets the marker.Sets the MDC context map.threadName(String threadName) Sets the thread name.Sets the throwable.timestamp(long timestampMillis) Sets the timestamp in milliseconds since epoch.
-
Method Details
-
loggerName
Sets the logger name. 设置日志记录器名称。- Parameters:
loggerName- the logger name | 日志记录器名称- Returns:
- this builder | 此构建器
-
throwable
Sets the throwable. 设置异常。- Parameters:
throwable- the throwable | 异常- Returns:
- this builder | 此构建器
-
marker
Sets the marker. 设置标记。- Parameters:
marker- the marker | 标记- Returns:
- this builder | 此构建器
-
mdc
Sets the MDC context map. 设置 MDC 上下文映射。- Parameters:
mdc- the MDC map | MDC 映射- Returns:
- this builder | 此构建器
-
timestamp
Sets the timestamp in milliseconds since epoch. 设置自纪元以来的毫秒时间戳。- Parameters:
timestampMillis- the timestamp | 时间戳- Returns:
- this builder | 此构建器
-
threadName
Sets the thread name. 设置线程名。- Parameters:
threadName- the thread name | 线程名- Returns:
- this builder | 此构建器
-
callerInfo
Sets the caller info. 设置调用者信息。- Parameters:
callerInfo- the caller info | 调用者信息- Returns:
- this builder | 此构建器
-
build
-