lib/defog/proxy.rb in defog-0.5.0 vs lib/defog/proxy.rb in defog-0.6.0
- old
+ new
@@ -8,10 +8,11 @@
attr_reader :proxy_root
attr_reader :persist
attr_reader :synchronize
attr_reader :max_cache_size
+
attr_reader :fog_wrapper # :nodoc:
# Opens a <code>Fog</code> cloud storage connection to map to a corresponding proxy
# directory. Use via, e.g.,
#
@@ -66,10 +67,15 @@
# The synchronization behavior can be overridden on a per-file basis
# when opening or closing a proxy (see Defog::Handle#open,
# Defog::File#close). Note that this applies only to upload of changes to
# proxy files that are opened as writeable; the download of data to
# readable proxy files always happens synchronously.
+ #
+ # If you specify
+ # :logger => an-instance-of-Logger
+ # (or provide a logger via #logger=), Defog will log downloads and
+ # upload using Logger#info.
def initialize(opts={})
opts = opts.keyword_args(:provider => :required,
:proxy_root => :optional,
:persist => :optional,
:synchronize => {:valid => [:async, true, false], :default => true},
@@ -120,9 +126,17 @@
end
# Returns the prefix that was passed
def prefix
@fog_wrapper.prefix
+ end
+
+ def logger
+ @fog_wrapper.logger
+ end
+
+ def logger=(log)
+ @fog_wrapper.logger= log
end
# Proxy a remote cloud file. Returns or yields a Defog::Handle object that
# represents the file.
#