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

subroutines as second arg for LOGCONFESS and LOGCROAK do not work as expected in easy mode #12

Closed
JC001010 opened this issue Mar 17, 2022 · 3 comments

Comments

@JC001010
Copy link

Using subroutines as second arg for a log message doesn't work as expected when using any of the LOG functions in easy mode. It shows the subroutine address instead of the returned value. Others such as LOGDIE work fine. See example here.

use Log::Log4perl::Tiny ":easy";

# This doesn't work:
LOGCONFESS "Names: ", sub{  join(",", qw/John Jane Mario/) };

#This works:
LOGDIE "Names: ", sub{  join(",", qw/John Jane Mario/) };

Both fail when writing to STDERR, but LOGDIE works fine when adding the messages to a file.

@polettix
Copy link
Owner

Thanks for reporting, I'll look into this shortly!

@polettix
Copy link
Owner

polettix commented Mar 19, 2022

This should hopefully fix it: https://github.com/polettix/Log-Log4perl-Tiny/tree/2de207c931ac2d984583df33ec99097fde36d669

I've sent trial release 1.4.1 to CPAN. It does not test the easy mode stuff because the problem was at the underlying level, please let me know if there are still residual issues (feel free to contribute a test case! 😄)

@polettix
Copy link
Owner

Should now be fixed in 1.6.0, please reopen if this is not the case. Thanks again! 😄

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

2 participants