File: 001-basic-usage.rb

package info (click to toggle)
ruby-yell 2.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 272 kB
  • sloc: ruby: 1,125; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 568 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# encoding: utf-8

require_relative '../lib/yell'

puts <<-EOS

# On the basics, Yell works just like any other logging library. 
#
# However, it enriches your log messages to make it more readable. By default, 
# it will format the given message as follows:

logger = Yell.new STDOUT
logger.info "Hello World!"

#=> "2012-02-29T09:30:00+01:00 [ INFO] 65784 : Hello World!"
#    ^                         ^       ^       ^
#    ISO8601 Timestamp         Level   Pid     Message


EOS

puts "=== actual example ==="
logger = Yell.new STDOUT
logger.info "Hello World!"