Skip to content

Commit

Permalink
#22 logs
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed May 15, 2024
1 parent 9154f8c commit 7f3ec06
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/judges/impex.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def import(strict: true)
fb = Factbase.new
if File.exist?(@file)
fb.import(File.binread(@file))
@loog.info("The factbase imported from #{@file.to_rel} (#{File.size(@file)} bytes)")
@loog.info("The factbase imported from #{@file.to_rel} (#{File.size(@file)} bytes, #{fb.size} facts)")
elsif strict
raise "The factbase is absent at #{@file.to_rel}"
end
Expand All @@ -49,12 +49,12 @@ def import(strict: true)
def import_to(fb)
raise "The factbase is absent at #{@file.to_rel}" unless File.exist?(@file)
fb.import(File.binread(@file))
@loog.info("The factbase loaded from #{@file.to_rel} (#{File.size(@file)} bytes)")
@loog.info("The factbase loaded from #{@file.to_rel} (#{File.size(@file)} bytes, #{fb.size} facts)")
end

def export(fb)
FileUtils.mkdir_p(File.dirname(@file))
File.binwrite(@file, fb.export)
@loog.info("Factbase exported to #{@file.to_rel} (#{File.size(@file)} bytes)")
@loog.info("Factbase exported to #{@file.to_rel} (#{File.size(@file)} bytes, #{fb.size} facts)")
end
end

0 comments on commit 7f3ec06

Please sign in to comment.