lib/rbbt/persist.rb in rbbt-util-5.13.11 vs lib/rbbt/persist.rb in rbbt-util-5.13.12

- old
+ new

@@ -132,11 +132,11 @@ Open.read(path).to_i else raise "Unknown persistence: #{ type }" end rescue - Log.warn "Exception loading #{ type } #{ path }: #{$!.message}" + Log.medium "Exception loading #{ type } #{ path }: #{$!.message}" raise $! end end def self.save_file(path, type, content) @@ -198,15 +198,15 @@ Thread.current["name"] = "file saver: " + path Misc.lock(path) do save_file(path, type, file) end rescue Aborted - Log.warn "Persist stream thread aborted: #{ Log.color :blue, path }" + Log.medium "Persist stream thread aborted: #{ Log.color :blue, path }" file.abort if file.respond_to? :abort raise $! rescue Exception - Log.warn "Persist stream thread exception: #{ Log.color :blue, path }" + Log.medium "Persist stream thread exception: #{ Log.color :blue, path }" file.abort if file.respond_to? :abort parent.raise $! raise $! end end @@ -227,14 +227,14 @@ Misc.lock(path) do save_file(path, type, file) end Log.high "Stream pipe saved: #{path}" rescue Aborted - Log.warn "Persist stream pipe exception: #{ Log.color :blue, path }" + Log.medium "Persist stream pipe exception: #{ Log.color :blue, path }" stream.abort if stream.respond_to? :abort rescue Exception - Log.warn "Persist stream pipe exception: #{ Log.color :blue, path }" + Log.medium "Persist stream pipe exception: #{ Log.color :blue, path }" Log.exception $! stream.abort if stream.respond_to? :abort stream.join if stream.respond_to? :join raise $! end @@ -244,11 +244,11 @@ begin while block = out.read(2028) sin.write block end rescue Aborted - Log.warn "Tee stream thread aborted" + Log.medium "Tee stream thread aborted" sout.abort if sout.respond_to? :abort sin.abort if sin.respond_to? :abort rescue Exception sin.abort if sin.respond_to? :abort sout.abort if sout.respond_to? :abort @@ -289,18 +289,18 @@ res = tee_stream(res, path, type, res.respond_to?(:callback)? res.callback : nil, res.respond_to?(:abort_callback)? res.abort_callback : nil) ConcurrentStream.setup res do begin lockfile.unlock if File.exists? lockfile.path and lockfile.locked? rescue - Log.warn "Lockfile exception: " << $!.message + Log.medium "Lockfile exception: " << $!.message end end res.abort_callback = Proc.new do begin lockfile.unlock if File.exists? lockfile.path and lockfile.locked? rescue - Log.warn "Lockfile exception: " << $!.message + Log.medium "Lockfile exception: " << $!.message end end raise KeepLocked.new res when TSV::Dumper stream = res.stream @@ -308,19 +308,19 @@ ConcurrentStream.setup res do begin stream.callback lockfile.unlock if File.exists? lockfile.path and lockfile.locked? rescue - Log.warn "Lockfile exception: " << $!.message + Log.medium "Lockfile exception: " << $!.message end end res.abort_callback = Proc.new do begin stream.abort lockfile.unlock if File.exists? lockfile.path and lockfile.locked? rescue - Log.warn "Lockfile exception: " << $!.message + Log.medium "Lockfile exception: " << $!.message end end raise KeepLocked.new res end end @@ -383,10 +383,10 @@ persist_options[:no_load] ? path : res end rescue - Log.warn "Error in persist: #{path}#{Open.exists?(path) ? Log.color(:red, " Erasing") : ""}" + Log.medium "Error in persist: #{path}#{Open.exists?(path) ? Log.color(:red, " Erasing") : ""}" FileUtils.rm path if Open.exists? path raise $! end end