From 23f06398902c149d05e82f1abcf6ae29f0233d16 Mon Sep 17 00:00:00 2001 From: Markus Hauru Date: Tue, 8 Sep 2020 16:58:52 +0200 Subject: [PATCH] Remove log formatting from demo --- demo/demo.jl | 1 - demo/demo_refine.jl | 1 - demo/demo_tools.jl | 24 ------------------------ 3 files changed, 26 deletions(-) diff --git a/demo/demo.jl b/demo/demo.jl index c08e8e5..b9be7e8 100644 --- a/demo/demo.jl +++ b/demo/demo.jl @@ -36,7 +36,6 @@ function parse_pars() end function main() - DemoTools.setlogger() pars = parse_pars() model = pars[:model] chi = pars[:chi] diff --git a/demo/demo_refine.jl b/demo/demo_refine.jl index 49fcd8a..eda796d 100644 --- a/demo/demo_refine.jl +++ b/demo/demo_refine.jl @@ -39,7 +39,6 @@ function parse_pars() end function main() - DemoTools.setlogger() pars = parse_pars() model = pars[:model] chi = pars[:chi] diff --git a/demo/demo_tools.jl b/demo/demo_tools.jl index 669f5d8..dc93279 100644 --- a/demo/demo_tools.jl +++ b/demo/demo_tools.jl @@ -3,7 +3,6 @@ module DemoTools using Logging -using Dates using LinearAlgebra using TensorKit using JLD2 @@ -15,29 +14,6 @@ export load_mera, store_mera export build_H_Ising, build_H_XXZ, build_magop export get_optimized_mera -# # # Log formatting - -function metafmt(level, _module, group, id, file, line) - color = Logging.default_logcolor(level) - levelstr = (level == Logging.Warn ? "Warning" : string(level)) - timestr = round(unix2datetime(time()), Dates.Second) - prefix = "$(levelstr) $(timestr):" - suffix = "" - Logging.Info <= level < Logging.Warn && return color, prefix, suffix - _module !== nothing && (suffix *= "$(_module)") - if file !== nothing - _module !== nothing && (suffix *= " ") - suffix *= Base.contractuser(file) - if line !== nothing - suffix *= ":$(isa(line, UnitRange) ? "$(first(line))-$(last(line))" : line)" - end - end - !isempty(suffix) && (suffix = "@ " * suffix) - return color, prefix, suffix -end - -setlogger() = global_logger(ConsoleLogger(stdout, Logging.Info; meta_formatter=metafmt)) - # # # Functions for creating Hamiltonians. """