diff options
| author | joonhoekim <26rote@gmail.com> | 2025-06-23 06:44:34 +0000 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-06-23 06:44:34 +0000 |
| commit | ebe273ef4564d55f9bf193adc51a9e58211e72e9 (patch) | |
| tree | 30e8c48be41d14751eceb4c24d88c18d03e9102b /lib | |
| parent | abd9f950bbd95b9ad713a26d3fd8a7e0282b7c51 (diff) | |
(김준회 SAML 2.0 SSO 리팩터링, 디버깅 유틸리티 추가, MOCK 처리 추가
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/debug-utils.ts | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/lib/debug-utils.ts b/lib/debug-utils.ts new file mode 100644 index 00000000..1d417ba5 --- /dev/null +++ b/lib/debug-utils.ts @@ -0,0 +1,72 @@ +// 개발 환경 디버그 유틸리티 + +const isDev = process.env.NODE_ENV === 'development'; +const isDebugEnabled = process.env.DEBUG === 'true' || isDev; + +/** + * 개발 환경에서만 console.log 출력 + */ +export function debugLog(message: string, ...args: any[]) { + if (isDebugEnabled) { + console.log(`🔍 ${message}`, ...args); + } +} + +/** + * 개발 환경에서만 console.error 출력 + */ +export function debugError(message: string, ...args: any[]) { + if (isDebugEnabled) { + console.error(`❌ ${message}`, ...args); + } +} + +/** + * 개발 환경에서만 console.warn 출력 + */ +export function debugWarn(message: string, ...args: any[]) { + if (isDebugEnabled) { + console.warn(`⚠️ ${message}`, ...args); + } +} + +/** + * 개발 환경에서만 성공 로그 출력 + */ +export function debugSuccess(message: string, ...args: any[]) { + if (isDebugEnabled) { + console.log(`✅ ${message}`, ...args); + } +} + +/** + * 개발 환경에서만 프로세스 로그 출력 + */ +export function debugProcess(message: string, ...args: any[]) { + if (isDebugEnabled) { + console.log(`🔐 ${message}`, ...args); + } +} + +/** + * 개발 환경에서만 Mock 모드 로그 출력 + */ +export function debugMock(message: string, ...args: any[]) { + if (isDebugEnabled) { + console.log(`🎭 ${message}`, ...args); + } +} + +/** + * 개발 환경 여부 확인 + */ +export function isDevMode(): boolean { + return isDev; +} + +/** + * 디버그 모드 여부 확인 (DEBUG=true 또는 NODE_ENV=development) + */ +export function isDebugMode(): boolean { + return isDebugEnabled; +}
\ No newline at end of file |
