[Koha-bugs] [Bug 22678] Set 'Koha::Logger' as the default mojo logger for the REST API

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Aug 29 14:46:08 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22678

--- Comment #19 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
(In reply to Tomás Cohen Arazi from comment #18)
> Please look at the return type for 'context':
> 
> https://docs.mojolicious.org/Mojo/Log.txt

Good catch. Although merely theoretical for now. We are not calling the log
context of Mojo in Koha currently.
We could however make sure that there is an (empty) arrayref inside?

>From Mojo:
sub context {
  my ($self, @context) = @_;
  return $self->new(parent => $self, context => \@context, level =>
$self->level);
}
sub _log {
  my ($self, $level) = (shift, pop);
  my @msgs = ref $_[0] eq 'CODE' ? $_[0]() : @_;
  unshift @msgs, @{$self->{context}} if $self->{context};
  ($self->{parent} || $self)->emit('message', $level, @msgs);
}

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list