Skip to content

Commit

Permalink
add loglevel to initilizer (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
jagreenwood authored Sep 25, 2024
1 parent c3426f3 commit 76b52b5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/DataDogLog/Public/DataDogLogHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public struct DataDogLogHandler: LogHandler, Sendable {
public var metadata = Logger.Metadata()

/// The minimum log level for a message to be logged. If a log's level is more severe or equal to this value, the log will be sent. Defaults to `info`.
public var logLevel = Logger.Level.info
public var logLevel: Logger.Level

/// The label to use for this handler. This is usually the service's name.
public var label: String
Expand All @@ -29,16 +29,19 @@ public struct DataDogLogHandler: LogHandler, Sendable {

/// - Parameters:
/// - label: The label to use for this handler
/// - logLevel: The minimum log level for a message to be logged
/// - key: The DataDog access key
/// - hostname: The name of the host sending logs
/// - region: The DataDog region to use, defaults to `US`
public init(
label: String,
logLevel: Logger.Level = .info,
key: String,
hostname: String? = nil,
site: Site = .US
) {
self.label = label
self.logLevel = logLevel
self.key = key
self.hostname = hostname
self.site = site
Expand Down

0 comments on commit 76b52b5

Please sign in to comment.