Open cossio opened 1 year ago
Since there can be arbitrary amount of arguments of any type, it's hardly reasonable to add formatting rules to logging facilities. So, there are two ways to control the formatting:
Miniloggers.jl
uses string
function to create output. So, you can pirate string
function for corresponding type and redefine it.@sprintf
or any other similar facilities to control output for each argument. Of course, it can be tedious, but it just work.Well, expanding on 1.
I can define something like present(x) = string(x)
and use it for output. This way, you'll need to redefine only present
function, which is still a piracy, but not as dramatic as redefining string
.
Suppose
x
is a float. I show it with:Usually this prints
x
with full precision. Is there a way to control the formatting (e.g. number of digits) of floating points ?