alert()에게 작별을
[IT] Ajaxian 2008/10/17 07:44 |
Blackbird는 G. Scott Olson씨가 작성한 JavaScript 로깅 라이브러리로 "Blackbird에게 환영을, alert()에게 작별을" 이라는 캐치 슬로건을 가지고 있습니다. 그 슬로건이야말로 Blackbird 라이브러리가 목표하는 바를 명확히 알 수 있게 해줍니다. 자바스크립트에서 메시지 로깅을 아주 쉽게 해주는 것입니다. 그리고 설치도 매우 쉽습니다. 아래 몇 줄의 코드만으로, 관심있는 특정 데이터를 표현해주는 체크포인트를 설정할 수 있게 됩니다.
Blackbird는 다음 브라우저들에서 테스트되었습니다.
from Say Goodbye to alert()
[code:html]
<html>
<head>
<script type="text/javascript" src="/PATH/TO/blackbird.js"></script>
<link type="text/css" rel="Stylesheet" href="/PATH/TO/blackbird.css" />
...
</head>
</html>
콘솔에 결과를 보내는 Blackbird의 메소드를 사용하는 것은 매우 간단한 일입니다.<html>
<head>
<script type="text/javascript" src="/PATH/TO/blackbird.js"></script>
<link type="text/css" rel="Stylesheet" href="/PATH/TO/blackbird.css" />
...
</head>
</html>
[code:js]
log.debug( 'this is a debug message' );
log.info( 'this is an info message' );
log.warn( 'this is a warning message' );
log.error( 'this is an error message' );
이러한 공개 메소드들이 보내진 메시지들의 유형을 쉽게 파악할 수 있도록 고유한 방식으로 데이터를 표현한다는 것도 장점입니다.log.debug( 'this is a debug message' );
log.info( 'this is an info message' );
log.warn( 'this is a warning message' );
log.error( 'this is an error message' );
Blackbird는 다음 브라우저들에서 테스트되었습니다.
- Internet Explorer 6+
- Firefox 2+
- Safari 2+
- Opera 9.5
from Say Goodbye to alert()
'[IT] Ajaxian' 카테고리의 다른 글
| Chrome에 Grease Monkey가! Userscripts가 곧 가능해질까? (0) | 2008/10/27 |
|---|---|
| jslibs - 브라우저에서 벗어난 자바스크립트 (0) | 2008/10/21 |
| Fennec (Mobile Firefox) Alpha 1 릴리스 (0) | 2008/10/21 |
| MAMA, 웹 표준을 누가 쓰죠? (0) | 2008/10/20 |
| alert()에게 작별을 (3) | 2008/10/17 |
| 웹 에디터 비교 (4) | 2008/10/14 |
| iPhone in Action 일부 챕터 다운로드 (0) | 2008/10/10 |
| Pyjamas: Python을 위한 GWT (0) | 2008/10/08 |
| IE 8 Beta 2 Ajax 기능 (0) | 2008/10/08 |
