Merge pull request #1715 from internetee/1712-improve-lhv-logging

Improve invoice processing logging
This commit is contained in:
Timo Võhmar 2020-10-19 13:35:50 +03:00 committed by GitHub
commit a2e7869678
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View file

@ -45,7 +45,7 @@ GIT
GIT
remote: https://github.com/internetee/lhv.git
revision: 1825240b3bf8b262418cc6c8ef7ed1aba386dd7d
revision: 1fb07818369425510a0172ad53bc86e85b6f83cc
branch: master
specs:
lhv (0.1.0)

View file

@ -23,6 +23,9 @@ namespace :invoices do
end
if incoming_transactions.any?
log 'Got incoming transactions'
log incoming_transactions
bank_statement = BankStatement.new(bank_code: Setting.registry_bank_code,
iban: Setting.registry_iban)
@ -41,8 +44,15 @@ namespace :invoices do
transaction.autobind_invoice
end
end
else
log 'Got no incoming transactions parsed, aborting'
end
puts "Transactions processed: #{incoming_transactions.size}"
end
def log(msg)
@log ||= Logger.new(STDOUT)
@log.info(msg)
end
end