Skip to content

Commit

Permalink
ConfigurableLoggerApp
Browse files Browse the repository at this point in the history
  • Loading branch information
justcoon committed Jan 15, 2024
1 parent 8182163 commit cef3251
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import zio.logging.{
LogAnnotation,
LoggerConfigurer,
loggerConfigPath,
makeSystemOutLogger
makeConsoleLogger
}
import zio.{ ExitCode, Runtime, Scope, ZIO, ZIOAppDefault, _ }

Expand All @@ -44,11 +44,9 @@ object ConfigurableLoggerApp extends ZIOAppDefault {
def configurableLogger(configPath: NonEmptyChunk[String] = loggerConfigPath) =
ConsoleLoggerConfig
.load(configPath)
.flatMap { consoleLoggerConfig =>
makeSystemOutLogger(
consoleLoggerConfig.format.toLogger
).map { logger =>
ConfigurableLogger.make(logger, consoleLoggerConfig.filter)
.flatMap { config =>
makeConsoleLogger(config).map { logger =>
ConfigurableLogger.make(logger, config.filter)
}
}
.install
Expand Down

0 comments on commit cef3251

Please sign in to comment.