Platform/iOS

[Debug] console log with color

개랭갱깽스타 2021. 10. 16. 22:36

Android 에서는 log 별로 color 를 지정할 수 있다. iOS 에도 이런 설정이 당연히 있겠지 라고 생각했는데.... 없다고 한다!

대신 아래처럼 emoji 를 이용해서 나타낸다고...! color 로 표현할 수 있게 해주라~~~

 

사용방법

print("⚠️", "Touch is not disabled as expected")

 

📕: error message

📙: warning message

📗: ok status message

📘: action message

📓: canceled status message

📔: Or anything you like and want to recognize immediately by color

 

출처

https://stackoverflow.com/questions/40583721/print-to-console-log-with-color

 

print() to console log with color

The code is: let redColor = "\u{001B}[0;31m" var message = "Some Message" print(redColor + message) //This doesn't work print("\(redColor)\(message)") //This also doesn't work and the output would

stackoverflow.com

 

반응형

'Platform > iOS' 카테고리의 다른 글

[Developer] 애플 기기등록 등  (0) 2021.10.16
[Push] FCM 사용하기  (0) 2021.10.16
[WebView] cookie 저장 및 불러오기  (0) 2021.10.09
[WebView] WKWebView  (0) 2021.08.10
[iOS] 앱의 생명주기와 앱의 구조  (0) 2021.05.07