Skip to content

Commit

Permalink
fix:dev: stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
Skulli committed Feb 20, 2025
1 parent 378331c commit 268632b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.4
3.3.7
9 changes: 6 additions & 3 deletions lib/secretariat/export/zugferd_pdf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ module ZugferdPdf
JAR_PATH = Secretariat.file_path("/lib/secretariat/export/bin/jar/Mustang-CLI-2.11.0.jar")

def self.logger
log_directory = File.expand_path("../../../../log", __FILE__)
FileUtils.mkdir_p(log_directory) unless Dir.exist?(log_directory)
# log_directory = File.expand_path("../../../../log", __FILE__)
# FileUtils.mkdir_p(log_directory) unless Dir.exist?(log_directory)

@@logger ||= Logger.new(File.join(log_directory, "export.log"))
# @@logger ||= Logger.new(File.join(log_directory, "export.log"))

@@logger ||= Logger.new(STDOUT)
end

def self.convert_a1_to_a3_params(pdf_a1, output_file_path)
Expand All @@ -26,6 +28,7 @@ def self.call_jar(params)
command = "java -Xmx1G -Dfile.encoding=UTF-8 -jar #{JAR_PATH} #{params}"

logger.info("Executing command: #{command}")
puts "Executing command: #{command}"

stdout, stderr, status = Open3.capture3(command)

Expand Down

0 comments on commit 268632b

Please sign in to comment.