Skip to content

Commit

Permalink
Remove log formatting from demo
Browse files Browse the repository at this point in the history
  • Loading branch information
mhauru committed Sep 8, 2020
1 parent 1517eac commit 23f0639
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 26 deletions.
1 change: 0 additions & 1 deletion demo/demo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ function parse_pars()
end

function main()
DemoTools.setlogger()
pars = parse_pars()
model = pars[:model]
chi = pars[:chi]
Expand Down
1 change: 0 additions & 1 deletion demo/demo_refine.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ function parse_pars()
end

function main()
DemoTools.setlogger()
pars = parse_pars()
model = pars[:model]
chi = pars[:chi]
Expand Down
24 changes: 0 additions & 24 deletions demo/demo_tools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
module DemoTools

using Logging
using Dates
using LinearAlgebra
using TensorKit
using JLD2
Expand All @@ -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.

"""
Expand Down

0 comments on commit 23f0639

Please sign in to comment.