Notice
Recent Posts
Recent Comments
Link
투케이2K
298. (ios/swift) SwiftLog 라이브러리 사용해 log 로그 출력 수행 실시 본문
[개발 환경 설정]
개발 툴 : XCODE
개발 언어 : SWIFT

[사전 설정]



[소스 코드]
// MARK: - [테스트 메인 함수 정의 실시]
func testMain() {
print("")
print("====================================")
print("[\(self.ACTIVITY_NAME) >> testMain() :: 테스트 함수 시작 실시]")
print("====================================")
print("")
/*
-------------------------------
[요약 설명]
-------------------------------
1. 설 명 : Swift 5 용으로 설계된 로그 출력 라이브러리 입니다
-------------------------------
2. 설치 주소 git 사이트 : https://github.com/apple/swift-log
-------------------------------
3. 필요 import 설정 :
import Logging
-------------------------------
*/
// [로직 처리 수행]
DispatchQueue.main.async {
// [Logger 인스턴스 생성 : 로그 label 설정]
let logger = Logger(label: "[A_Intro]")
// [로그 출력 실시]
logger.info("INFO : TWOK")
logger.warning("WARNING : TWOK")
logger.error("ERROR : TWOK")
}
}
[결과 출력]

반응형
'IOS' 카테고리의 다른 글
Comments