BazerUtils.jl

Assorted Julia utilities including custom logging
Log | Files | Refs | README | LICENSE

commit 7b8fdfaeebc469194e3cdbe8b70e9ace64b8fb8c
parent fe0392df3e7ddf36fb1487dda3f4aec9ac84a665
Author: Erik Loualiche <[email protected]>
Date:   Sun, 15 Feb 2026 23:52:18 -0600

fix batch-mode custom_logger and remove .vscode

- custom_logger() with no args now uses PROGRAM_FILE (the running
  script) as log base name. Previously used @__FILE__ which always
  resolved to CustomLogger.jl at parse time.
- Remove empty .vscode/settings.json

Co-Authored-By: Claude Opus 4.6 <[email protected]>

Diffstat:
Msrc/CustomLogger.jl | 15++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/CustomLogger.jl b/src/CustomLogger.jl @@ -209,17 +209,14 @@ function custom_logger( end -# version for starting julia in batch mode -function custom_logger(; - kwargs...) - - if abspath(PROGRAM_FILE) == @__FILE__ # true if not in REPL - custom_logger(@__FILE__; - kwargs...) +# Convenience for batch mode: uses PROGRAM_FILE as the log filename base +function custom_logger(; kwargs...) + if !isempty(PROGRAM_FILE) + logbase = splitext(abspath(PROGRAM_FILE))[1] + custom_logger(logbase; kwargs...) else - @error "Could not get proper filename for logger ... filename = $(@__FILE__)" + @error "custom_logger() with no arguments requires a script context (PROGRAM_FILE is empty in the REPL)" end - end # --------------------------------------------------------------------------------------------------