@@ -11,8 +11,8 @@ A structured event logger
1111``` ruby
1212require ' fluent-logger'
1313
14- log = Fluent ::Logger ::FluentLogger .new (nil , :host => ' localhost' , :port => 24224 )
15- unless log.post(" myapp.access" , {" agent" => " foo" })
14+ log = Fluent ::Logger ::FluentLogger .new (nil , :host => ' localhost' , :port => 24224 )
15+ unless log.post(" myapp.access" , {" agent" => " foo" })
1616 p log.last_error # You can get last error object via last_error method
1717end
1818
2424``` ruby
2525require ' fluent-logger'
2626
27- log = Fluent ::Logger ::FluentLogger .new (nil , :socket_path => " /tmp/fluent.sock" )
28- unless log.post(" myapp.access" , {" agent" => " foo" })
27+ log = Fluent ::Logger ::FluentLogger .new (nil , :socket_path => " /tmp/fluent.sock" )
28+ unless log.post(" myapp.access" , {" agent" => " foo" })
2929 p log.last_error # You can get last error object via last_error method
3030end
3131
3636``` ruby
3737require ' fluent-logger'
3838
39- Fluent ::Logger ::FluentLogger .open (nil , :host => ' localhost' , :port => 24224 )
40- Fluent ::Logger .post(" myapp.access" , {" agent" => " foo" })
39+ Fluent ::Logger ::FluentLogger .open (nil , :host => ' localhost' , :port => 24224 )
40+ Fluent ::Logger .post(" myapp.access" , {" agent" => " foo" })
4141
4242# output: myapp.access {"agent":"foo"}
4343```
@@ -46,8 +46,8 @@ Fluent::Logger.post("myapp.access", {"agent"=>"foo"})
4646``` ruby
4747require ' fluent-logger'
4848
49- log = Fluent ::Logger ::FluentLogger .new (' myapp' , :host => ' localhost' , :port => 24224 )
50- log.post(" access" , {" agent" => " foo" })
49+ log = Fluent ::Logger ::FluentLogger .new (' myapp' , :host => ' localhost' , :port => 24224 )
50+ log.post(" access" , {" agent" => " foo" })
5151
5252# output: myapp.access {"agent":"foo"}
5353```
@@ -72,7 +72,7 @@ f.warn("some application running.")
7272``` ruby
7373require ' fluent-logger'
7474f = Fluent ::Logger ::LevelFluentLogger .new (' fluent' )
75- f.info(" some_application" ){" some application running." }
75+ f.info(" some_application" ) {" some application running." }
7676# output: fluent.info: {"level":"INFO","message":"some application running.","progname":"some_application"}
7777```
7878
@@ -82,7 +82,7 @@ f.info("some_application"){"some application running."}
8282require ' fluent-logger'
8383f = Fluent ::Logger ::LevelFluentLogger .new (' fluent' )
8484f.level = Logger ::WARN
85- f.info(" some_application" ){" some application running." }
85+ f.info(" some_application" ) {" some application running." }
8686```
8787
8888Log level is ERROR so no output.
@@ -113,7 +113,7 @@ f.info("some_application"){"some application running."}
113113
114114### Fluent
115115``` ruby
116- Fluent ::Logger ::FluentLogger .open (' tag_prefix' , :host => ' localhost' , :port => 24224 )
116+ Fluent ::Logger ::FluentLogger .open (' tag_prefix' , :host => ' localhost' , :port => 24224 )
117117```
118118
119119### Console
0 commit comments