Skip to content

Commit

Permalink
Convert vault Logger to a local variable (#771)
Browse files Browse the repository at this point in the history
  • Loading branch information
bolsinga authored Mar 6, 2024
1 parent 231461c commit 6d654d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Sources/Site/Music/AtlasCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ actor AtlasCache<T: AtlasGeocodable> {

private var staggerOffset = 0.0
private var cache: [T: Value] = [:]

private let atlasCache = Logger(category: "atlasCache")

internal init(fileName: String = "atlas.json") {
Expand Down
9 changes: 3 additions & 6 deletions Sources/Site/Music/Vault+URL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
import Foundation
import os

extension Logger {
static let vault = Logger(category: "vault")
}

enum VaultError: Error {
case illegalURL(String)
}
Expand All @@ -33,9 +29,10 @@ extension Vault {
}

public static func load(url: URL, artistsWithShowsOnly: Bool = true) async throws -> Vault {
Logger.vault.log("start")
let vault = Logger(category: "vault")
vault.log("start")
defer {
Logger.vault.log("end")
vault.log("end")
}
let music = try await Music.load(url: url)
return await Vault.create(music: artistsWithShowsOnly ? music.showsOnly : music, url: url)
Expand Down

0 comments on commit 6d654d5

Please sign in to comment.