Andrew Thompson
23e7bc085d
Port improper iolist support from io_lib_format.erl & add tests
9 年前
James Fish
8685853c91
Add maps formatting
Note that compiling on OTP 17.0, or later, will produce beam files
(specifically lager_trunc_io) that are incompatible with R16B03-1, or
earlier, due to erlang:is_map/1 using a new beam opcode (156). However
if compiled on R16B03-1, or earlier, will produce beams files that are
compatible with 17.0, and later, and maps will be formatted where
supported by the active OTP release.
10 年前
Andrew Thompson
4c7bd96d62
Remove the workaround for the bug when printing empty binaries in W mode
The fix for this was merged in R16 somewhere, so this workaround is no
longer needed, and fixes the EQC test from spotting the divergent
behaviour with io_lib.
See also: http://erlang.org/pipermail/erlang-patches/2012-September/003034.html
11 年前
Andrew Thompson
c8eed35184
Remove broken code for stripping square brackets
12 年前
Andrew Thompson
80e53076fc
Fix some bugs uncovered in review
12 年前
Andrew Thompson
932b482e4a
Support printing iolists with ~s
12 年前
Andrew Thompson
ecebfe4269
Reject invalid format strings more aggressively
12 年前
Andrew Thompson
9bd0a411a3
Support pretty printing records found in a module at compile time
12 年前
Andrew Thompson
ed7e2aac35
Test and fix for a printable yet improper list
12 年前
Andrew Thompson
35872409bc
Use quickcheck to test for formatting equivalenve with io_lib
Various bugs uncovered during this testing were fixed and added to the
test suite.
12 年前
Andrew Thompson
05718792ae
Whitespace cleanups
13 年前
Micah Warren
7af0b9c94e
Added test for very short field width on ~s
13 年前
Micah Warren
06103bbf9a
Quick fix for issue#64
There are still differences between the erlang io_lib and the trunc_io in
how ~p/~P are handled, but a first step is useful here.
13 年前
Andrew Thompson
f5ca930b2e
Vertical tab support
13 年前
Andrew Thompson
d416dc0a20
Fix escaped char printing in ~p mode, reported by @etrepum
13 年前
Andrew Thompson
efc7b7591b
Changes suggested by Kostis, Dialyzer -Wunmatched_returns and Tidier
13 年前
Kostis Sagonas
e9c4d77bea
Fix specs so that they correspond to the code
13 年前
Andrew Thompson
79b8fd1b05
Don't break printing lists of binaries
13 年前
Andrew Thompson
6b7f1dd4a3
Support for printing bitstrings (reported by @freeaakk )
Bitstrings are binaries that don't end on an 8 bit boundary, so dealing
with the trailing bits is annoying. Thanks to the bit_size bif we don't
have to resort to io_lib for printing them.
13 年前
Bryan Fink
c2b5f9f67c
don't quote atoms just for containing numerals
As long as the numeral is not the first character, it shouldn't force
quoting on the atom. For example, abc123 does not need quotes.
13 年前
Brendan Hay
446ca91d50
Prefixing alist/3 error to make it compile on R13A
13 年前
Andrew Thompson
5068e29383
Fix a couple minor issues with length calculation, add tests
13 年前
Andrew Thompson
3311702a6d
Add builtin chomping to lager_format
13 年前
Andrew Thompson
31d9529e3e
Default to treating lists as strings, (and set it false for ~w)
13 年前
Andrew Thompson
9c6ce62ff8
Fix some more formatting bugs
13 年前
Andrew Thompson
9e735a72ad
Improve tests, fix some minor bugs
13 年前
Andrew Thompson
d16dfaa0f8
Implement ~P/~W style depth-limiting
13 年前
Andrew Thompson
e5b58fc71e
Implement print options for trunc_io so ~s/~p/~w emulation is more accurate
Specifically, the handling of lists/binaries/atoms is closer to
io_lib:format's behaviour, and some regular expressions are eliminated.
13 年前
Andrew Thompson
e45d5bc3c9
Implement an alternative and much faster lager_trunc_io:format/3
13 年前
Andrew Thompson
5140cb3449
Don't convert \r, etc to spaces, don't assume printablility by first char
13 年前
Andrew Thompson
7e9da648db
Several fixes for printing binaries, improve quote stripping
In string mode, "..", '..' and <<"..">> are stripped, just like with
io:format.
13 年前
Andrew Thompson
af4ea7f31d
Don't treat floats in a list as printable characters Reported by @bryanhughes
The test if an element in a list was in the printable range didn't
handle the case of a float in the list that compared to be in the
printable range.
14 年前
Andrew Thompson
a0440a9d60
Smarter doublequote stripping when printing strings with ~s
14 年前
Andrew Thompson
9a577df2e0
Use the io_lib_format:fwrite_g function to print floats
This is superior to float_to_list as it only prints the meaningful
digits and 1.0 isn't rendered as "1.00000000000000000000e+00".
14 年前
Andrew Thompson
3babca112c
Make sure atoms needing quoting are quoted.
14 年前
Andrew Thompson
95f87e5d8b
Remove unecessary and pointless call to lists:flatten
14 年前
Andrew Thompson
03d3fa1a95
Fixes and tests for deep-list handling in trunc_io:format
This solves an issue reported by 'cloudhead' in IRC where deep lists
weren't being flattened when printed with format specifiers like ~s ~p
and ~P, all of which should flatten the list.
14 年前
Andrew Thompson
9cbb72c3ca
Cleanup some commented out code
14 年前
Andrew Thompson
6a8403f371
Fix edoc generation
14 年前
Andrew Thompson
4ac01374fa
Rename trunc_io to lager_trunc_io to prevent clashes
14 年前
Andrew Thompson
d230cbaa02
More fixes found by QC and some QC improvements
14 年前
Andrew Thompson
71fae1b89a
Truncator for funs; special case binary truncation when max is 0
14 年前
Andrew Thompson
f3b9fbd0fb
Take the size of the format string into account when printing
14 年前
Andrew Thompson
37f190f037
Try to give more equal allocations to large terms
14 年前
Andrew Thompson
01dc584838
Add truc_io:format and use it in the crash logger
14 年前
Andrew Thompson
5bc97a9096
Forgot to add trunc_io
14 年前