-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from boostcampwm-2024/feature/set-logger
OSLog 사용을 위한 MHLogger 구현
- Loading branch information
Showing
2 changed files
with
31 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.