File: 003.2-formatting-BasicFormat.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 (22 lines) | stat: -rw-r--r-- 463 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# encoding: utf-8

require_relative '../lib/yell'

puts <<-EOS

# The basic formating string looks like: %l, %d: %m.

logger = Yell.new STDOUT, format: Yell::BasicFormat
logger.info "Hello World!"
#=> "I, 2012-02-29T09:30:00+01:00 : Hello World!"
#    ^  ^                          ^
#    ^  ISO8601 Timestamp          Message
#    Level (short)


EOS

puts "=== actual example ==="
logger = Yell.new STDOUT, format: Yell::BasicFormat
logger.info "Hello World!"