diff --git a/src/TBLogger.jl b/src/TBLogger.jl index 7f665109..1b86f925 100644 --- a/src/TBLogger.jl +++ b/src/TBLogger.jl @@ -231,3 +231,21 @@ function handle_message(lg::TBLogger, level, message, _module, group, id, file, iter = increment_step!(lg, i_step) write_event(lg.file, make_event(lg, summ, step=iter)) end + +######################### Methods for pretty printing ########################## +Base.show(io::IO, tbl::TBLogger) = begin + str = "TBLogger(\"$(tbl.logdir)\"), min_level=$(tbl.min_level), "* + "purge_step=$(tbl.global_step))" + Base.print(io, str) +end + +Base.show(io::IO, mime::MIME"text/plain", tbl::TBLogger) = begin + str = """ + TBLogger: + - Log level : $(tbl.min_level) + - Current step : $(tbl.global_step) + - Output : $(tbl.logdir) + - open files : $(length(tbl.all_files)) + """ + Base.print(io, str) +end