Skip to content

Commit

Permalink
adding more detail to logging output
Browse files Browse the repository at this point in the history
  • Loading branch information
kflemin committed Sep 7, 2021
1 parent 08d3363 commit 46f9270
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/buildingsync/translator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ def initialize(xml_file_path, output_dir, epw_file_path = nil, standard_to_be_us
if validate_xml_file_against_schema
validate_xml
else
OpenStudio.logFree(OpenStudio::Info, 'BuildingSync.Translator.initialize', "File '#{xml_file_path}' was not validated against the BuildingSync schema")
puts "File '#{xml_file_path}' was not validated against the BuildingSync schema"
OpenStudio.logFree(OpenStudio::Info, 'BuildingSync.Translator.initialize', "File '#{xml_file_path}' was not validated against the BuildingSync schema version #{@schema_version}")
puts "File '#{xml_file_path}' was not validated against the BuildingSync schema version #{@schema_version}"
end

super(doc, ns)
Expand All @@ -109,11 +109,12 @@ def validate_xml
if !selection_tool.validate_schema
raise "File '#{@xml_file_path}' does not valid against the BuildingSync schema"
else
OpenStudio.logFree(OpenStudio::Info, 'BuildingSync.Translator.initialize', "File '#{@xml_file_path}' is valid against the BuildingSync schema")
OpenStudio.logFree(OpenStudio::Info, 'BuildingSync.Translator.initialize', "File '#{@xml_file_path}' is valid against the BuildingSync schema version #{@schema_version}")
puts "File '#{@xml_file_path}' is valid against the BuildingSync schema"
end
rescue StandardError
OpenStudio.logFree(OpenStudio::Error, 'BuildingSync.Translator.initialize', "File '#{@xml_file_path}' does not valid against the BuildingSync schema")
rescue StandardError => error
puts "ERROR: #{error}"
OpenStudio.logFree(OpenStudio::Error, 'BuildingSync.Translator.initialize', "File '#{@xml_file_path}' does not validate against the BuildingSync schema version #{@schema_version}")
end

# @see WorkflowMaker.setup_and_sizing_run
Expand Down

0 comments on commit 46f9270

Please sign in to comment.