11import tracer from "dd-trace" ;
22import express from 'express' ;
3- import { BuffLog } from './bufflog' ;
3+ import bufflog from './bufflog' ;
44
55tracer . init ( {
66 hostname : "dd-agent-hostname" ,
77 logInjection : false
88} ) ;
99
10- let logger = new BuffLog ( ) ;
11-
12- logger . info ( 'hello info' ) ;
13- logger . notice ( 'hello notice' ) ;
14- logger . notice ( 'hello notice with context' , { "test" :"toto" } ) ;
15- logger . warning ( 'hello warning' ) ;
16- logger . error ( 'hello error' ) ;
17- logger . critical ( 'hello critical' ) ;
18- logger . critical ( 'hello critical' , { "some" :"stuff" } ) ;
10+ bufflog . info ( 'hello info' ) ;
11+ bufflog . notice ( 'hello notice' ) ;
12+ bufflog . notice ( 'hello notice with context' , { "test" :"toto" } ) ;
13+ bufflog . warning ( 'hello warning' ) ;
14+ bufflog . error ( 'hello error' ) ;
15+ bufflog . critical ( 'hello critical' ) ;
16+ bufflog . critical ( 'hello critical' , { "some" :"stuff" } ) ;
1917
2018const app = express ( ) ;
2119
@@ -24,12 +22,11 @@ app.listen(4000, () => {
2422} ) ;
2523
2624app . get ( '/' , ( req , res ) => {
27- var logger = new BuffLog ( ) ;
28- logger . notice ( "Notice log via endpoint" ) ;
29- logger . info ( 'hello info' ) ;
30- logger . debug ( 'hello debug' ) ;
31- logger . notice ( 'hello notice' ) ;
32- logger . warning ( 'hello warning' ) ;
33- logger . error ( 'hello error' ) ;
34- logger . critical ( 'hello critical' ) ;
25+ bufflog . notice ( "Notice log via endpoint" ) ;
26+ bufflog . info ( 'hello info' ) ;
27+ bufflog . debug ( 'hello debug' ) ;
28+ bufflog . notice ( 'hello notice' ) ;
29+ bufflog . warning ( 'hello warning' ) ;
30+ bufflog . error ( 'hello error' ) ;
31+ bufflog . critical ( 'hello critical' ) ;
3532} ) ;
0 commit comments