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
|
data.tsv
|
||||||
Q*.docx
|
Q*.docx
|
||||||
Q*.md
|
Q*.md
|
||||||
|
*.log
|
||||||
|
|
10
main.jl
10
main.jl
|
@ -1,6 +1,13 @@
|
||||||
#!/usr/bin/env julia
|
#!/usr/bin/env julia
|
||||||
using CSV
|
using CSV
|
||||||
using DataFrames
|
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
|
# Import data
|
||||||
survey_data = DataFrame(CSV.File("data.tsv"; delim='\t', normalizenames=true))
|
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`)
|
run(`pandoc $q.md -o $q.docx`)
|
||||||
|
|
||||||
end #for
|
end #for
|
||||||
|
|
||||||
|
# Close log file
|
||||||
|
close(log_io)
|
||||||
|
|
Loading…
Reference in a new issue