(
message: unknown,
cause: Cause.Cause<any>,
overrideLogLevel: Option.Option<LogLevel.LogLevel>
)
| 857 | } |
| 858 | |
| 859 | log( |
| 860 | message: unknown, |
| 861 | cause: Cause.Cause<any>, |
| 862 | overrideLogLevel: Option.Option<LogLevel.LogLevel> |
| 863 | ): void { |
| 864 | const logLevel = Option.isSome(overrideLogLevel) ? |
| 865 | overrideLogLevel.value : |
| 866 | this.getFiberRef(core.currentLogLevel) |
| 867 | const minimumLogLevel = this.getFiberRef(currentMinimumLogLevel) |
| 868 | if (LogLevel.greaterThan(minimumLogLevel, logLevel)) { |
| 869 | return |
| 870 | } |
| 871 | const spans = this.getFiberRef(core.currentLogSpan) |
| 872 | const annotations = this.getFiberRef(core.currentLogAnnotations) |
| 873 | const loggers = this.getLoggers() |
| 874 | const contextMap = this.getFiberRefs() |
| 875 | if (HashSet.size(loggers) > 0) { |
| 876 | const clockService = Context.get(this.getFiberRef(defaultServices.currentServices), clock.clockTag) |
| 877 | const date = new Date(clockService.unsafeCurrentTimeMillis()) |
| 878 | Inspectable.withRedactableContext(contextMap, () => { |
| 879 | for (const logger of loggers) { |
| 880 | logger.log({ |
| 881 | fiberId: this.id(), |
| 882 | logLevel, |
| 883 | message, |
| 884 | cause, |
| 885 | context: contextMap, |
| 886 | spans, |
| 887 | annotations, |
| 888 | date |
| 889 | }) |
| 890 | } |
| 891 | }) |
| 892 | } |
| 893 | } |
| 894 | |
| 895 | /** |
| 896 | * Evaluates a single message on the current thread, while the fiber is |
no test coverage detected