Skip to content

Commit

Permalink
Make tests respect the LOG_LEVEL env var (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
gwynne authored May 16, 2020
1 parent 7251abf commit 3303411
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Tests/SQLiteKitTests/SQLKitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,14 @@ class SQLiteTests: XCTestCase {
}
}

func env(_ name: String) -> String? {
getenv(name).flatMap { String(cString: $0) }
}

let isLoggingConfigured: Bool = {
LoggingSystem.bootstrap { label in
var handler = StreamLogHandler.standardOutput(label: label)
handler.logLevel = .trace
handler.logLevel = env("LOG_LEVEL").flatMap { Logger.Level(rawValue: $0) } ?? .debug
return handler
}
return true
Expand Down

0 comments on commit 3303411

Please sign in to comment.