Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10613 (new enhancement)

Opened 5 months ago

Last modified 5 months ago

[PATCH] ActionController#silence should use its logger's silence method

Reported by: dubek Assigned to: core
Priority: normal Milestone: 2.x
Component: ActionPack Version: edge
Severity: minor Keywords: unverified
Cc:

Description

There's already code for silencing the logger in ActiveSupport: Logger#silence. Why not use it? This patch makes ActionController#silence use its logger's silence method. This way, simple overriding of the silence method (if needed) can be done by overriding the logger instance.

Note that the popular SyslogLogger also implements a silence method, so now problem for their users. However, this patch might break other loggers which don't have a silence method. Is someone familiar with other loggers for Rails?

Moreover, the test now uses mocha instead of defining special mock classes.

Attachments

action_controller_logger_silence_patch.diff (2.3 kB) - added by dubek on 12/25/07 18:03:55.

Change History

12/25/07 18:03:55 changed by dubek

  • attachment action_controller_logger_silence_patch.diff added.

12/25/07 18:07:57 changed by dubek

Regarding SyslogLogger, I actually meant: no problem for their users.

Sorry.

12/29/07 08:46:43 changed by dubek

  • keywords set to unverified.