Skip to content

Commit

Permalink
Apply sub-logger formatters then owned formatters in composite logger
Browse files Browse the repository at this point in the history
  • Loading branch information
jnewc committed Jan 30, 2020
1 parent d9d4535 commit 95ef888
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cosmic.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "Cosmic"
s.version = "7.2.1"
s.version = "7.2.2"
s.summary = "A log reporting framework written in Swift"

s.description = <<-DESC
Expand Down
4 changes: 1 addition & 3 deletions Sources/Cosmic/Loggers/CompositeLogger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ open class CompositeLogger: Logger {

public func log(_ message: String, logLevel: LogLevel, metadata: LogMetadata) {
loggers.forEach { logger in
let formattedMessage = formatters.reduce(message) { message, formatter in
return formatter.format(message: message, logLevel: logLevel, metadata: metadata)
}
let formattedMessage = self.format(logger.format(message, logLevel, metadata), logLevel, metadata)
logger.log(formattedMessage, logLevel: logLevel, metadata: metadata)
}
}
Expand Down

0 comments on commit 95ef888

Please sign in to comment.