-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Debug 목적으로 console.log를 일부러 남겨둔 경우 현재는 eslint-disable no-console을 이용하여 lint warning을 제거하고 있습니다.
다만 로그를 남길 때 마다 eslint-disable no-console를 추가해야하는 문제가 있어 코드가 깔끔하지 못해지는 문제가 있어 아래와 같은 해결 방안을 검토할 필요가 있습니다.
- src/common/_Util.es6의 static method를 추가하는 방법 (333d5d2)
- _Util을 통해 log method에 접근하는 것이 어색한 느낌을 줄 수 있습니다. (또한 이를 위해 매번 _Util을 import해야 합니다.)
- _Util에 method를 추가하다보니 log는 적절하지만 error, warn의 명칭이 적절하지 않게 됩니다. 하지만 logError 등과 같이 이름을 변경하면 log method를 이용하기 번거로워집니다.
- src/common/_Util.es6의 하단에 window.log = { log: console.log, warn: console.warn, error: console.error }를 추가하는 방법
- global namespace에 logger object를 추가한다는 단점이 있습니다.
Metadata
Metadata
Assignees
Labels
No labels