Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lager_truncation_size does not work #211

Open
coolchevy opened this issue Mar 13, 2014 · 7 comments
Open

lager_truncation_size does not work #211

coolchevy opened this issue Mar 13, 2014 · 7 comments

Comments

@coolchevy
Copy link

option {lager_truncation_size, 1024}
does not work on current master

Data was truncated on default (?DEFAULT_TRUNCATION) size

@Vagabond
Copy link
Member

It works if I use it like this:

erlc -pa ebin +'{lager_truncation_size, 100}' test.erl

With a file like this:

-module(test).

-export([start/0]).

-compile([{parse_transform, lager_transform}, {lager_truncation_size, 100}]).

start() ->
  lager:info("~p", [string:copies("hello wrld", 20)]).

But note that the -compile option inside the module does not work (don't ask me why).

@coolchevy
Copy link
Author

I can't find info fun in lager module. Where is it? May be you use not master branch?
Thanks

@Vagabond
Copy link
Member

It is created via a parse transform.

@coolchevy
Copy link
Author

Thank you, really it works by lager:info, but truncation doesn't work if you call error_logger:info_msg. Message truncated by DEFAULT_TRUNCATION

1> test:start().
11:28:49.318 [info] "hello..."
ok
11:28:49.318 [info] DBG: "hello wrldhello wrldhello wrldhello wrldhello wrldhello wrldhello wrldhello wrldhello wrldhello wrldhello wrldhello wrldhello wrldhello wrldhello wrldhello wrldhello wrldhello wrldhello wrldhello wrld"
2>

can you fix it?

@Vagabond
Copy link
Member

Right, those messages are covered by a different truncation limit, which is not (currently) configurable.

@andytill
Copy link

The transform could check the attributes in the AST for lager_truncation_size if it can't find it in the options. This would allow lager_truncation_size to be specified in the -compile attribute in the module. It is confusing that it doesn't work, though that is nothing to do with lager :)

@Basho-JIRA Basho-JIRA changed the title lager_truncation_size does not work lager_truncation_size does not work [JIRA: RIAK-1772] Apr 23, 2015
@Basho-JIRA Basho-JIRA assigned jonmeredith and unassigned seancribbs May 7, 2015
@jadeallenx
Copy link
Member

Dup of #162

@jadeallenx jadeallenx changed the title lager_truncation_size does not work [JIRA: RIAK-1772] lager_truncation_size does not work May 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants