Skip to content

Commit

Permalink
Create explicit public initializer for LogHandler struct
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrothera committed Apr 23, 2024
1 parent ab7455c commit ec847f7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Sources/TelemetryClient/LogHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public struct LogHandler {
let logLevel: LogLevel
let handler: (LogLevel, String) -> Void

public init(logLevel: LogLevel, handler: @escaping (LogLevel, String) -> Void) {
self.logLevel = logLevel
self.handler = handler
}

internal func log(_ level: LogLevel = .info, message: String) {
if level.rawValue >= logLevel.rawValue {
handler(level, message)
Expand Down

0 comments on commit ec847f7

Please sign in to comment.