Method: Timber::Config#debug_to_file
- Defined in:
- lib/timber/config.rb
#debug_to_file(file_path) ⇒ Object
A convenience method for writing debug messages to a file.
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/timber/config.rb', line 49 def debug_to_file(file_path) unless File.exist? File.dirname path FileUtils.mkdir_p File.dirname path end file = File.open file_path, "a" file.binmode file.sync = config.autoflush_log file_logger = ::Logger.new(file) self.debug_logger = file_logger end |