-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDebugLogger.swift
More file actions
69 lines (59 loc) · 1.54 KB
/
DebugLogger.swift
File metadata and controls
69 lines (59 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//
// DebugLogger.swift
// Divary
//
// Created by AI Assistant on 1/12/26.
//
import Foundation
/// 디버그 빌드에서만 로그를 출력하는 헬퍼
struct DebugLogger {
/// 일반 로그
static func log(_ message: String, file: String = #file, function: String = #function, line: Int = #line) {
#if DEBUG
let fileName = (file as NSString).lastPathComponent
print("[\(fileName):\(line)] \(message)")
#endif
}
/// 성공 로그 (✅)
static func success(_ message: String) {
#if DEBUG
print("✅ \(message)")
#endif
}
/// 경고 로그 (⚠️)
static func warning(_ message: String) {
#if DEBUG
print("⚠️ \(message)")
#endif
}
/// 에러 로그 (❌)
static func error(_ message: String) {
#if DEBUG
print("❌ \(message)")
#endif
}
/// 정보 로그 (🔵)
static func info(_ message: String) {
#if DEBUG
print("🔵 \(message)")
#endif
}
/// 네트워크 로그 (🌐)
static func network(_ message: String) {
#if DEBUG
print("🌐 \(message)")
#endif
}
/// 토큰 관련 로그 (🔑)
static func token(_ message: String) {
#if DEBUG
print("🔑 \(message)")
#endif
}
/// 구분선 출력
static func separator(_ length: Int = 60, char: String = "=") {
#if DEBUG
print(String(repeating: char, count: length))
#endif
}
}