From 529d411bf96b9bf0c57dd06f5afecc65e91a136d Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 19 Jul 2009 16:36:31 +0200 Subject: configurable debug_level and debug_file --- ranger.conf | 5 +++++ ranger.rb | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ranger.conf b/ranger.conf index 5fcef6bf..628c42d9 100644 --- a/ranger.conf +++ b/ranger.conf @@ -33,6 +33,11 @@ Option.colorscheme = 'default' # If value is >0, there's a short, annoying delay after clicks Option.mouse_interval = 200 +# for debugging. the debug level defines how much is logged. +# 0 = nothing, 1 = fatal errors, 2 = errors, 3 = debug info +Option.debug_level = 3 +Option.debug_file = '/tmp/errorlog' + # ask for a confirmation before deleting things? Option.confirm_string = "yes I am!" Option.confirm = true diff --git a/ranger.rb b/ranger.rb index 5bd71303..413a98b4 100755 --- a/ranger.rb +++ b/ranger.rb @@ -46,6 +46,8 @@ opt = { :preview => true, :mouse => true, :mouse_interval => 200, + :debug_level => 3, + :debug_file => '/tmp/errorlog', :colorscheme => 'default', :cd => ARGV.include?('--cd'), } @@ -64,8 +66,8 @@ load 'data/screensaver/clock.rb' include Debug Debug.setup( :name => 'nyuron', - :file => '/tmp/errorlog', - :level => 3 ) + :file => Option.debug_file, + :level => Option.debug_level ) if pwd and !ARGV.empty? and !File.directory?(pwd) file = Directory::Entry.new(pwd) -- cgit 1.4.1-2-gfad0