lib/ruote/log/fs_history.rb in ruote-2.1.6 vs lib/ruote/log/fs_history.rb in ruote-2.1.7

- old
+ new

@@ -120,11 +120,11 @@ # Returns an array of messages for a given day or an empty array if nothing # happened at that date. # def by_date (date) - date = Time.parse(date.to_s).strftime('%F') + date = Time.parse(date.to_s).strftime('%Y-%m-%d') lines = File.readlines(File.join(@path, "history_#{date}.json")) rescue [] lines.inject([]) do |a, l| if r = (Rufus::Json.decode(l) rescue nil) @@ -156,11 +156,11 @@ def notify (msg) rotate_if_necessary @file.puts(Rufus::Json.encode( - [ "#{@last.strftime('%F %T')}.#{"%06d" % @last.usec}", msg ])) + [ "#{@last.strftime('%Y-%m-%d %T')}.#{"%06d" % @last.usec}", msg ])) @file.flush end protected @@ -171,10 +171,10 @@ return if prev && prev.day == @last.day @file.close rescue nil - fn = [ 'history', @last.strftime('%F') ].join('_') + '.json' + fn = [ 'history', @last.strftime('%Y-%m-%d') ].join('_') + '.json' @file = File.open(File.join(@path, fn), 'a') end end end