Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/auxiliary/logger.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export log_header, log_row

const formats = Dict{DataType, String}(Signed => "%-5d",
AbstractFloat => "%-8.1e",
AbstractString => "%-15s",
Symbol => "%-15s",
Missing => "%-15s"
const formats = Dict{DataType, String}(Signed => "%6d",
AbstractFloat => "%8.1e",
AbstractString => "%15s",
Symbol => "%15s",
Missing => "%15s"
)

const default_headers = Dict{Symbol, String}(:name => "Name",
Expand All @@ -15,8 +15,8 @@ const default_headers = Dict{Symbol, String}(:name => "Name",

for (typ, fmt) in formats
hdr_fmt_foo = Symbol("header_formatter_$typ")
len = match(r"\%-([0-9]*)", fmt)[1]
fmt2 = "%-$(len)s"
len = match(r"\%([0-9]*)", fmt)[1]
fmt2 = "%$(len)s"

@eval begin
row_formatter(x :: $typ) = @sprintf($fmt, x)
Expand Down