diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2011-04-23 02:53:30 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2011-04-23 02:54:07 +0530 |
commit | b22f39ec6f887725dd2780032a9a5be10217b7cb (patch) | |
tree | a95f47b6590abc2354d4f73ce43c54790cdbc139 /railties/guides | |
parent | 98b700e0bfe836c7ee4754344202dd15c7ee0f2c (diff) | |
download | rails-b22f39ec6f887725dd2780032a9a5be10217b7cb.tar.gz rails-b22f39ec6f887725dd2780032a9a5be10217b7cb.tar.bz2 rails-b22f39ec6f887725dd2780032a9a5be10217b7cb.zip |
fix indentation
Diffstat (limited to 'railties/guides')
-rw-r--r-- | railties/guides/source/active_support_core_extensions.textile | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile index c937da834c..b57adbb517 100644 --- a/railties/guides/source/active_support_core_extensions.textile +++ b/railties/guides/source/active_support_core_extensions.textile @@ -3421,11 +3421,11 @@ h4. +silence+ Silences every log level lesser to the specified one for the duration of the given block. Log level orders are: debug, info, error and fatal. <ruby> - logger = Logger.new("log/development.log") - logger.silence(Logger::INFO) do - logger.debug("In space, no one can hear you scream.") - logger.info("Scream all you want, small mailman!") - end +logger = Logger.new("log/development.log") +logger.silence(Logger::INFO) do + logger.debug("In space, no one can hear you scream.") + logger.info("Scream all you want, small mailman!") +end </ruby> h4. +datetime_format=+ @@ -3433,17 +3433,17 @@ h4. +datetime_format=+ Modifies the datetime format output by the formatter class associated with this logger. If the formatter class does not have a +datetime_format+ method then this is ignored. <ruby> - class Logger::FormatWithTime < Logger::Formatter - cattr_accessor(:datetime_format) { "%Y%m%d%H%m%S" } +class Logger::FormatWithTime < Logger::Formatter + cattr_accessor(:datetime_format) { "%Y%m%d%H%m%S" } - def self.call(severity, timestamp, progname, msg) - "#{timestamp.strftime(datetime_format)} -- #{String === msg ? msg : msg.inspect}\n" - end + def self.call(severity, timestamp, progname, msg) + "#{timestamp.strftime(datetime_format)} -- #{String === msg ? msg : msg.inspect}\n" end +end - logger = Logger.new("log/development.log") - logger.formatter = Logger::FormatWithTime - logger.info("<- is the current time") +logger = Logger.new("log/development.log") +logger.formatter = Logger::FormatWithTime +logger.info("<- is the current time") </ruby> NOTE: Defined in +active_support/core_ext/logger.rb+. |