Subject: | openlog gets called multiple times |
Please see
https://github.com/sdt/Log-Any-Adapter-Syslog/commit/e69e1c17d0e4eb90fb888dc67689e51c6c0bee0e
I don't have a test case for this problem, but simply tracing out a
message before the call to openlog makes it pretty obvious.
The commit message for the above patch:
Moved the $_opened flag to package scope.
Each package that does 'use Log::Any qw($log)' gets its own $log object.
New Adapter objects are created for each one, and each only gets init()
called once. Each adapter object has the same hash keys/values, except
for $self->{category}.
Changed the $_opened flag to package scope to correctly guard against
calling openlog multiple times.
Cheers,
Stephen Thirlwall