Logging
Vahana utilize Julia's Standard Logging Library to optionally create log files with e.g. the duration of the transition functions. For each process a seperate file is created.
Vahana.set_log_path
— Functionset_log_path(path::String)
Specify the path that is used to save the log files. If the directory does not exist, it is created the first time a log file is written.
Must be called before create_simulation
. If this is not done, the log files are written to a subfolder log
of the current working directory.
Vahana.create_logger!
— Functioncreate_logger!(sim::Simulation, [debug = false, name = sim.name; overwrite = sim.overwrite_file])
The canonical way to create log files for a simulation is by setting the logging keyword of create_simulation
to true. But sometime it can be useful to control this manually, e.g. after a call to copy_simulation
.
When also debug
is set to true, the log file contains more details and the stream will be flushed after each write.
The filename
argument can be used to specify a filename other than sim.filename
. If overwrite
is true, existing files with this name will be overwritten. If it is false, the filename is automatically extended by an increasing 6-digit number, so that existing files are not overwritten.
The files are always created in a log
subfolder, and this one will be create in the current working directory.
Logging.with_logger
— Functionwith_logger(f::Function, sim::Simulation)
Execute function f, directing all log messages to the logger that is attached to simulation sim
.
Vahana.log_overview
— Functionlog_overview(sim::Simulation)
Dump an overview of the simulation sim
to the attached logfile.