feat: Add logging to script
This commit is contained in:
parent
b5200c5a8a
commit
cc3d2908ed
2 changed files with 11 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -33,3 +33,4 @@ docs/site/
|
|||
data.tsv
|
||||
Q*.docx
|
||||
Q*.md
|
||||
*.log
|
||||
|
|
10
main.jl
10
main.jl
|
@ -1,6 +1,13 @@
|
|||
#!/usr/bin/env julia
|
||||
using CSV
|
||||
using DataFrames
|
||||
using Dates
|
||||
using Logging
|
||||
|
||||
# Set logging to file
|
||||
log_io = open("antimicrobial-use-survey-analysis_$(now()).log", "w+")
|
||||
logger = SimpleLogger(log_io)
|
||||
global_logger(logger)
|
||||
|
||||
# Import data
|
||||
survey_data = DataFrame(CSV.File("data.tsv"; delim='\t', normalizenames=true))
|
||||
|
@ -33,3 +40,6 @@ for q in questions
|
|||
run(`pandoc $q.md -o $q.docx`)
|
||||
|
||||
end #for
|
||||
|
||||
# Close log file
|
||||
close(log_io)
|
||||
|
|
Loading…
Reference in a new issue