Skip to content

Commit

Permalink
Merge pull request #62 from boostcampwm-2024/feature/set-logger
Browse files Browse the repository at this point in the history
OSLog 사용을 위한 MHLogger 구현
  • Loading branch information
Kyxxn authored Nov 16, 2024
2 parents ae41a5f + a421884 commit 1ad7b14
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
31 changes: 31 additions & 0 deletions MemorialHouse/MHCore/MHCore/MHLogger.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import OSLog

public enum MHLogger {
public static func debug<T>(_ object: T?) {
#if DEBUG
let message = object != nil ? "[Debug] \(object!)" : "[Debug] nil"
os_log(.debug, "%@", message)
#endif
}

public static func info<T>(_ object: T?) {
#if DEBUG
let message = object != nil ? "[Info] \(object!)" : "[Info] nil"
os_log(.info, "%@", message)
#endif
}

public static func error<T>(_ object: T?) {
#if DEBUG
let message = object != nil ? "[Error] \(object!)" : "[Error] nil"
os_log(.error, "%@", message)
#endif
}

public static func network<T>(_ object: T?) {
#if DEBUG
let message = object != nil ? "[Network] \(object!)" : "[Network] nil"
os_log(.debug, "%@", message)
#endif
}
}
9 changes: 0 additions & 9 deletions MemorialHouse/MHCore/MHCore/Temp.swift

This file was deleted.

0 comments on commit 1ad7b14

Please sign in to comment.