Skip to content
This repository has been archived by the owner on Apr 13, 2019. It is now read-only.

fatal logging doesn't #141

Open
hickey opened this issue Sep 9, 2013 · 2 comments · May be fixed by #192
Open

fatal logging doesn't #141

hickey opened this issue Sep 9, 2013 · 2 comments · May be fixed by #192

Comments

@hickey
Copy link

hickey commented Sep 9, 2013

When attempting to use the built in logger with a fatal message, the following errors get produced:

[2013/09/09 03:14:17.584] !! /Users/ghickey/.rvm/gems/ruby-1.9.3-p327/gems/cinch-2.0.7/lib/cinch/logger.rb:133:in `format_message': undefined method `format_fatal' for #<Cinch::Logger::FormattedLogger:0x007fc1f2036bf8> (NoMethodError)
[2013/09/09 03:14:17.584] !!    /Users/ghickey/.rvm/gems/ruby-1.9.3-p327/gems/cinch-2.0.7/lib/cinch/logger.rb:115:in `block (2 levels) in log'
[2013/09/09 03:14:17.584] !!    /Users/ghickey/.rvm/gems/ruby-1.9.3-p327/gems/cinch-2.0.7/lib/cinch/logger.rb:113:in `each'
[2013/09/09 03:14:17.584] !!    /Users/ghickey/.rvm/gems/ruby-1.9.3-p327/gems/cinch-2.0.7/lib/cinch/logger.rb:113:in `block in log'
[2013/09/09 03:14:17.584] !!    <internal:prelude>:10:in `synchronize'
[2013/09/09 03:14:17.584] !!    /Users/ghickey/.rvm/gems/ruby-1.9.3-p327/gems/cinch-2.0.7/lib/cinch/logger.rb:112:in `log'
[2013/09/09 03:14:17.584] !!    /Users/ghickey/.rvm/gems/ruby-1.9.3-p327/gems/cinch-2.0.7/lib/cinch/logger_list.rb:19:in `block in log'
[2013/09/09 03:14:17.584] !!    /Users/ghickey/.rvm/gems/ruby-1.9.3-p327/gems/cinch-2.0.7/lib/cinch/logger_list.rb:19:in `each'
[2013/09/09 03:14:17.584] !!    /Users/ghickey/.rvm/gems/ruby-1.9.3-p327/gems/cinch-2.0.7/lib/cinch/logger_list.rb:19:in `log'
[2013/09/09 03:14:17.584] !!    /Users/ghickey/.rvm/gems/ruby-1.9.3-p327/gems/cinch-2.0.7/lib/cinch/helpers.rb:135:in `log'
[2013/09/09 03:14:17.585] !!    /Users/ghickey/.rvm/gems/ruby-1.9.3-p327/gems/cinch-2.0.7/lib/cinch/helpers.rb:150:in `fatal'
[2013/09/09 03:14:17.585] !!    /Volumes/ebay-Projects/sobot/plugins/pid_file.rb:59:in `create_pidfile'
[2013/09/09 03:14:17.585] !!    /Users/ghickey/.rvm/gems/ruby-1.9.3-p327/gems/cinch-2.0.7/lib/cinch/plugin.rb:318:in `block (2 levels) in __register_listeners'
[2013/09/09 03:14:17.585] !!    /Users/ghickey/.rvm/gems/ruby-1.9.3-p327/gems/cinch-2.0.7/lib/cinch/handler.rb:88:in `call'
[2013/09/09 03:14:17.585] !!    /Users/ghickey/.rvm/gems/ruby-1.9.3-p327/gems/cinch-2.0.7/lib/cinch/handler.rb:88:in `block in call'

Further testing gives the following results:

debug: works as expected -- [2013/09/09 03:30:42.132] !! [Cinch::PidFile] This is debug
info: works as expected -- [2013/09/09 03:30:42.134] II [Cinch::PidFile] This is info
warn: message get printed as a debug message -- [2013/09/09 03:30:42.135] !! [Cinch::PidFile] This is warn
error: no logging decorations, just the message -- [Cinch::PidFile] This is error

exception is probably working given that fatal is throwing an exception and the above output displays it (with red !!)

@hickey
Copy link
Author

hickey commented Sep 9, 2013

Also it would really be great if abort really complained loudly so that the message did not mix in with the other messages. Currently it acts much like error where just the text is printed.

@dominikh
Copy link
Member

dominikh commented Sep 9, 2013

What is abort? Did you mean fatal?

@Casao Casao linked a pull request Mar 15, 2015 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants