J
jerry
I've been using Log::StdLog for logging, but find that when I tell it
to log a utf-8 string containing non-ASCII characters, I get the ol'
warning:
Wide character in print at....
Now, when writing to a file, the fix for this is
binmode (FILE, ":utf8") ;
But is there a way to fix Log::StdLog without going in and hacking the
source code?
Log::StdLog is initialized like this:
use Log::StdLog { level => 'all', file => "PerlRun.log"} ;
and then when you want to log a message, you do
print {*STDLOG} info => "This is a message.\n" ;
So, I probably need to do something like
binmode (STDLOG, ":utf8") ;
but I can't get any such syntax to work. I've looked at the
Log::StdLog source code but it's way over my head. I don't understand
what the asterisk does prefixing STDLOG. I thought that perl did not
have an asterisk dereferencing operator.
Thanks,
Jerry Krinock
to log a utf-8 string containing non-ASCII characters, I get the ol'
warning:
Wide character in print at....
Now, when writing to a file, the fix for this is
binmode (FILE, ":utf8") ;
But is there a way to fix Log::StdLog without going in and hacking the
source code?
Log::StdLog is initialized like this:
use Log::StdLog { level => 'all', file => "PerlRun.log"} ;
and then when you want to log a message, you do
print {*STDLOG} info => "This is a message.\n" ;
So, I probably need to do something like
binmode (STDLOG, ":utf8") ;
but I can't get any such syntax to work. I've looked at the
Log::StdLog source code but it's way over my head. I don't understand
what the asterisk does prefixing STDLOG. I thought that perl did not
have an asterisk dereferencing operator.
Thanks,
Jerry Krinock