Skip to content

Commit

Permalink
Print logs to stdout instead of a log file (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
Technici4n authored Nov 9, 2024
1 parent 739fecf commit 6850996
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/AiidaDFTK.jl
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,11 @@ function is expected to be called from queuing system jobscripts, for example:
```bash
julia --project -e 'using AiidaDFTK; AiidaDFTK.run()' /path/to/input/file.json
```
It automatically dumps a logfile `file.log` (i.e. basename of the input file
with the log extension), which contains the log messages (i.e. @info, @warn, ...).
Currently stdout and stderr are still printed.
"""
function run()
# TODO Json logger ?
inputfile = only(ARGS)
logfile = first(splitext(basename(inputfile))) * ".log"
if mpi_master()
global_logger(SimpleLogger(open(logfile, "w")))
# Default logging to stdout
else
global_logger(NullLogger())
end
Expand All @@ -196,7 +190,7 @@ function run()
@warn("Found ~/.julia in Julia depot path. " *
"Ensure that you properly specify JULIA_DEPOT_PATH.")
end
run_json(inputfile; extra_output_files=[logfile])
run_json(inputfile)
end


Expand Down

0 comments on commit 6850996

Please sign in to comment.