File: 003.3-formatting-ExtendedFormat.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 (21 lines) | stat: -rw-r--r-- 528 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
# encoding: utf-8

require_relative '../lib/yell'

puts <<-EOS

# The extended formatting string looks like: %d [%5L] %p %h : %m.

logger = Yell.new STDOUT, format: Yell::ExtendedFormat
logger.info "Hello World!"
#=> "2012-02-29T09:30:00+01:00 [ INFO] 65784 localhost : Hello World!"
#    ^                          ^      ^     ^           ^
#    ISO8601 Timestamp          Level  Pid   Hostname    Message


EOS

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