Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
forks
lager
Commits
c8eed351
Commit
c8eed351
authored
12 years ago
by
Andrew Thompson
Browse files
Options
Download
Email Patches
Plain Diff
Remove broken code for stripping square brackets
parent
80e53076
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lager_trunc_io.erl
+5
-7
src/lager_trunc_io.erl
with
5 additions
and
7 deletions
+5
-7
src/lager_trunc_io.erl
View file @
c8eed351
...
...
@@ -149,7 +149,7 @@ print(Bin, Max, _Options) when is_binary(Bin), Max < 2 ->
{
"<<...>>"
,
7
};
print
(
Binary
,
Max
,
Options
)
when
is_binary
(
Binary
)
->
B
=
binary_to_list
(
Binary
,
1
,
lists
:
min
([
Max
,
byte_size
(
Binary
)])),
{
L
,
Len
}
=
case
Options
#print_options.lists_as_strings
orelse
{
Res
,
Len
gth
}
=
case
Options
#print_options.lists_as_strings
orelse
Options
#print_options.force_strings
of
true
->
Depth
=
Options
#print_options.depth
,
...
...
@@ -198,12 +198,6 @@ print(Binary, Max, Options) when is_binary(Binary) ->
_
->
list_body
(
B
,
Max
-
4
,
dec_depth
(
Options
),
true
)
end
,
{
Res
,
Length
}
=
case
L
of
[
91
,
X
,
93
]
->
{
X
,
Len
-
2
};
X
->
{
X
,
Len
}
end
,
case
Options
#print_options.force_strings
of
true
->
{
Res
,
Length
};
...
...
@@ -611,6 +605,9 @@ binary_printing_test() ->
?
assertEqual
(
"<<
\"
hello
\\
fworld
\"
>>"
,
lists
:
flatten
(
format
(
"
~p
"
,
[
<<
"hello
\f
world"
>>
],
50
))),
?
assertEqual
(
"<<
\"
hello
\\
vworld
\"
>>"
,
lists
:
flatten
(
format
(
"
~p
"
,
[
<<
"hello
\v
world"
>>
],
50
))),
?
assertEqual
(
" hello"
,
lists
:
flatten
(
format
(
"
~10s
"
,
[
<<
"hello"
>>
],
50
))),
?
assertEqual
(
"[a]"
,
lists
:
flatten
(
format
(
"
~s
"
,
[
<<
"[a]"
>>
],
50
))),
?
assertEqual
(
"[a]"
,
lists
:
flatten
(
format
(
"
~s
"
,
[[
<<
"[a]"
>>
]],
50
))),
ok
.
bitstring_printing_test
()
->
...
...
@@ -679,6 +676,7 @@ iolist_printing_test() ->
lists
:
flatten
(
format
(
"
~s
"
,
[[
<<
"123456789"
>>
,
"HellIamaniolist"
]],
13
))),
?
assertEqual
(
"123456789HellIamaniolist"
,
lists
:
flatten
(
format
(
"
~s
"
,
[[
<<
"123456789"
>>
,
"HellIamaniolist"
]],
30
))),
ok
.
tuple_printing_test
()
->
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help