This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Add a new "insane" logging level, which will output all IMAP commands…

… and responses to STDERR.
  • Loading branch information...
1 parent d689af4 commit 52bf33ecfe5569e67d7c2e1b5df9f8691cc0a652 @rgrove committed Mar 26, 2009
Showing with 12 additions and 7 deletions.
  1. +2 −0 HISTORY
  2. +2 −0 bin/larch
  3. +1 −1 larch.gemspec
  4. +6 −5 lib/larch/logger.rb
  5. +1 −1 lib/larch/version.rb
View
@@ -9,6 +9,8 @@ Version 1.0.1 (?)
contains a huge number of messages.
* Don't try to trap POSIX signals on platforms that aren't likely to support
them, and don't die if the platform sniffing doesn't save us.
+ * Add a new "insane" logging level, which will output all IMAP commands and
+ responses to STDERR.
Version 1.0.0 (2009-03-17)
* First release.
View
@@ -74,6 +74,8 @@ EOS
# Go go go!
init(options[:verbosity])
+ Net::IMAP.debug = true if @log.level == :insane
+
source = IMAP.new(options[:from], options[:from_user], options[:from_pass],
:fast_scan => options[:fast_scan],
:max_retries => options[:max_retries])
View
@@ -1,7 +1,7 @@
Gem::Specification.new do |s|
s.name = 'larch'
s.summary = 'Larch syncs messages from one IMAP server to another. Awesomely.'
- s.version = "1.0.0.2"
+ s.version = "1.0.0.3"
s.author = "Ryan Grove"
s.email = "ryan@wonko.com"
s.homepage = "http://github.com/rgrove/larch/"
View
@@ -4,11 +4,12 @@ class Logger
attr_reader :level, :output
LEVELS = {
- :fatal => 0,
- :error => 1,
- :warn => 2,
- :info => 3,
- :debug => 4
+ :fatal => 0,
+ :error => 1,
+ :warn => 2,
+ :info => 3,
+ :debug => 4,
+ :insane => 5
}
def initialize(level = :info, output = $stdout)
View
@@ -1,6 +1,6 @@
module Larch
APP_NAME = 'Larch'
- APP_VERSION = '1.0.0.2'
+ APP_VERSION = '1.0.0.3'
APP_AUTHOR = 'Ryan Grove'
APP_EMAIL = 'ryan@wonko.com'
APP_URL = 'http://github.com/rgrove/larch/'

0 comments on commit 52bf33e

Please sign in to comment.