But here is the most basic example I can come up with:
irb(main):007:0> mdfranz@franz-t61:~$ irb
irb(main):001:0> require 'syslog'
=> true
irb(main):002:0> Syslog.open('labradoodle')
=> <#Syslog: opened=true, ident="labradoodle", options=3, facility=8, mask=255>
irb(main):003:0> Syslog.crit('w00f w00f')
=> <#Syslog: opened=true, ident="labradoodle", options=3, facility=8, mask=255>
irb(main):004:0> Syslog.close
=> nil
irb(main):005:0> Syslog.crit('w00f w00f')
RuntimeError: must open syslog before write
from (irb):5:in `crit'
from (irb):5
from :0
And /var/log/syslog
Aug 8 10:03:22 franz-t61 labradoodle[3688]: w00f w00f
Aug 8 10:04:24 franz-t61 kernel: [ 9700.304000] iwl4965: REPLY_ADD_STA failed
Aug 8 10:06:27 franz-t61 kernel: [ 9823.088000] iwl4965: REPLY_ADD_STA failed
No comments:
Post a Comment