ProjectTorreyPines / FUSE.jl

FUsion Synthesis Engine
https://fuse.help
Apache License 2.0
32 stars 2 forks source link

Review FUSE logging system #260

Open orso82 opened 1 year ago

orso82 commented 1 year ago

Also, is there a way to turn warning messages into errors (also for packages that I do not own?) @sjkelly use this as starting point https://discourse.julialang.org/t/terminate-after-warning-is-thrown-global-setting/80368/3

jguterl commented 1 year ago

see filtering method for logging: e.g.

terminator = EarlyFilteredLogger(global_logger()) do log_args
           if log_args.level >= Logging.Warn
               println(stderr, "ERROR: Log message with higher level than Logging.Warn, terminating process.")
               exit(-1)
           end
           return true
       end;

Example of filtering in line 20: https://github.com/ProjectTorreyPines/PlasmaFacingSurfaces.jl/blob/master/src/PlasmaFacingSurfaces.jl