A C4::Logger module would be useful ?
HI all, I have developped a logging module (based on LogLite). I think it could be useful for Koha. A new system preference controls the log level (eg. level warning for production and debug for development). It can be used by a simple script or into Koha. How it works: See Bug 8190 ( http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8190) Please have a look at that, and tell me what do you think about it. Technically, is it satisfying for you? I think it could help us to increase the code quality. Any others ideas are welcome ! ++ Jonathan
Jonathan, I have developped a logging module (based on LogLite). I think it could be
useful for Koha.
A new system preference controls the log level (eg. level warning for production and debug for development).
It can be used by a simple script or into Koha.
How it works: See Bug 8190 ( http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8190)
Please have a look at that, and tell me what do you think about it. Technically, is it satisfying for you?
+1 from me for the idea. I didn't look at the code, but I love the idea. Regards, Jared -- Jared Camins-Esakov Bibliographer, C & P Bibliography Services, LLC (phone) +1 (917) 727-3445 (e-mail) jcamins@cpbibliography.com (web) http://www.cpbibliography.com/
On 6 June 2012 02:17, Jared Camins-Esakov <jcamins@cpbibliography.com> wrote:
Jonathan,
I have developped a logging module (based on LogLite). I think it could be useful for Koha.
A new system preference controls the log level (eg. level warning for production and debug for development).
It can be used by a simple script or into Koha.
How it works: See Bug 8190 (http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8190)
Please have a look at that, and tell me what do you think about it. Technically, is it satisfying for you?
+1 from me for the idea. I didn't look at the code, but I love the idea.
What he said ! Chris
On Wed, Jun 06, 2012 at 02:22:20AM +1200, Chris Cormack wrote:
On 6 June 2012 02:17, Jared Camins-Esakov <jcamins@cpbibliography.com> wrote:
Jonathan,
I have developped a logging module (based on LogLite). I think it could be useful for Koha.
A new system preference controls the log level (eg. level warning for production and debug for development).
It can be used by a simple script or into Koha.
How it works: See Bug 8190 (http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8190)
Please have a look at that, and tell me what do you think about it. Technically, is it satisfying for you?
+1 from me for the idea. I didn't look at the code, but I love the idea.
What he said !
+1 from me. Should we also wrap warn(s) to emit debug output like this? $SIG{__WARN__} = sub { C4::Logger->new->debug( @_ ); } Right now every warn in code makes patch fail QA (I know that first hand ;-) and it seems to me it's easier to just put warn instead of C4::Logger->new->debug( "this used to be warn" );
2012/6/5 Dobrica Pavlinusic <dpavlin@rot13.org>
On Wed, Jun 06, 2012 at 02:22:20AM +1200, Chris Cormack wrote:
On 6 June 2012 02:17, Jared Camins-Esakov <jcamins@cpbibliography.com> wrote:
Jonathan,
I have developped a logging module (based on LogLite). I think it could be useful for Koha.
A new system preference controls the log level (eg. level warning for production and debug for development).
It can be used by a simple script or into Koha.
How it works: See Bug 8190 (http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8190)
Please have a look at that, and tell me what do you think about it. Technically, is it satisfying for you?
+1 from me for the idea. I didn't look at the code, but I love the idea.
What he said !
+1 from me.
Should we also wrap warn(s) to emit debug output like this?
$SIG{__WARN__} = sub { C4::Logger->new->debug( @_ ); }
Right now every warn in code makes patch fail QA (I know that first hand ;-) and it seems to me it's easier to just put warn instead of
C4::Logger->new->debug( "this used to be warn" );
The idea is to use the global variable $log, instead of call each times C4::Logger->new Your ligne become: $log->debug("my debug message"); Yes it's a little bit longer. But if you have a structure, you can call debug with a flag in 2nd param like this: $hash; $log->debug($hash, 1); instead of warn Data::Dumper::Dumper $hash; it's shorter ;-)
Le 05/06/2012 17:01, Dobrica Pavlinusic a écrit :
$SIG{__WARN__} = sub { C4::Logger->new->debug( @_ ); }
Right now every warn in code makes patch fail QA (I know that first hand ;-) and it seems to me it's easier to just put warn instead of
C4::Logger->new->debug( "this used to be warn" );
I have nothing against this option, as it achieve the goal of having a user-defined logging level. At the moment, what fails QA is unconditional warns that fill everyone's log file ! -- Paul POULAIN http://www.biblibre.com Expert en Logiciels Libres pour l'info-doc Tel : (33) 4 91 81 35 08
I approve of the idea, though shouldn't it be in the Koha:: namespace? Jonathan Druart <jonathan.druart@biblibre.com> wrote:
HI all,
I have developped a logging module (based on LogLite). I think it could be useful for Koha.
A new system preference controls the log level (eg. level warning for production and debug for development).
It can be used by a simple script or into Koha.
How it works: See Bug 8190 ( http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8190)
Please have a look at that, and tell me what do you think about it. Technically, is it satisfying for you?
I think it could help us to increase the code quality.
Any others ideas are welcome !
++ Jonathan
------------------------------------------------------------------------
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
-- Sent from Kaiten Mail for Android. Please excuse my brevity.
+1 for this good idea +1 for Koha::Logger Saludos To+ On Tue, Jun 5, 2012 at 12:09 PM, Robin Sheat <robin@catalyst.net.nz> wrote:
I approve of the idea, though shouldn't it be in the Koha:: namespace?
Jonathan Druart <jonathan.druart@biblibre.com> wrote:
HI all,
I have developped a logging module (based on LogLite). I think it could be useful for Koha.
A new system preference controls the log level (eg. level warning for production and debug for development).
It can be used by a simple script or into Koha.
How it works: See Bug 8190 (http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8190)
Please have a look at that, and tell me what do you think about it. Technically, is it satisfying for you?
I think it could help us to increase the code quality.
Any others ideas are welcome !
++ Jonathan
________________________________
Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
-- Sent from Kaiten Mail for Android. Please excuse my brevity.
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
Le 05/06/2012 17:12, Tomas Cohen Arazi a écrit :
+1 for this good idea +1 for Koha::Logger While I agree for Koha:: namespace, I disagree for Koha::Logged.pm. We need a more granular organization of the Koha:: namespace.
Something like Koha::Tools::Logger or Koha::Internal::Logger, or whatever express that the Logger module is related to internals of Koha. Reminder : there is an action_log table. A newbie could think that Koha::Logger is related to this table. (I would favour something like Koha::Database::Action_log for the table) -- Paul POULAIN http://www.biblibre.com Expert en Logiciels Libres pour l'info-doc Tel : (33) 4 91 81 35 08
On Tue, Jun 5, 2012 at 11:45 AM, Paul Poulain <paul.poulain@biblibre.com>wrote:
Le 05/06/2012 17:12, Tomas Cohen Arazi a écrit :
+1 for this good idea +1 for Koha::Logger While I agree for Koha:: namespace, I disagree for Koha::Logged.pm. We need a more granular organization of the Koha:: namespace.
Something like Koha::Tools::Logger or Koha::Internal::Logger, or whatever express that the Logger module is related to internals of Koha.
+1 to the idea and +1 to something like Koha::Tools::Foo Kind Regards, Chris
Le 05/06/2012 17:58, Chris Nighswonger a écrit :
Something like Koha::Tools::Logger or Koha::Internal::Logger, or whatever express that the Logger module is related to internals of Koha.
Reviving this thread : We have a "Tools" module in Koha, using Koha::Tools::Foo could be confusing. I spoke of this with Joubu, he will submit in the next days a patch using Koha::Utils::Logger.pm, and I suggest to adopt Koha::Utils:: to put generic Koha utilities. bug 8190 will probably be to sign-off before the end of the week ;-) -- Paul POULAIN http://www.biblibre.com Expert en Logiciels Libres pour l'info-doc Tel : (33) 4 91 81 35 08
To me it is more complicated. The C4::Logger I proposed is not dependant of Koha (i.e. there is no "use C4::Module;" or "use Koha::Module;"). I think we need a Lib::Koha and a Lib::External (or Lib::Logger directly or Lib::What::Ever::Logger). 2012/6/5 Paul Poulain <paul.poulain@biblibre.com>
Le 05/06/2012 17:12, Tomas Cohen Arazi a écrit :
+1 for this good idea +1 for Koha::Logger While I agree for Koha:: namespace, I disagree for Koha::Logged.pm. We need a more granular organization of the Koha:: namespace.
Something like Koha::Tools::Logger or Koha::Internal::Logger, or whatever express that the Logger module is related to internals of Koha.
Reminder : there is an action_log table. A newbie could think that Koha::Logger is related to this table. (I would favour something like Koha::Database::Action_log for the table)
-- Paul POULAIN http://www.biblibre.com Expert en Logiciels Libres pour l'info-doc Tel : (33) 4 91 81 35 08 _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
Le 06/06/2012 08:28, Jonathan Druart a écrit :
To me it is more complicated. The C4::Logger I proposed is not dependant of Koha (i.e. there is no "use C4::Module;" or "use Koha::Module;"). I think we need a Lib::Koha and a Lib::External (or Lib::Logger directly or Lib::What::Ever::Logger). Are you implying this could be a Perl cpan module, and just become a dependency of Koha ? I reviewed your code, and can't see any Koha specifics, so that could be an option. -- Paul POULAIN http://www.biblibre.com Expert en Logiciels Libres pour l'info-doc Tel : (33) 4 91 81 35 08
I approve of the idea, though shouldn't it be in the Koha:: namespace? you're perfectly right. and the naming convention for the Koha:: namespace is something I want to discuss during the hackfest to build a
Le 05/06/2012 17:09, Robin Sheat a écrit : proposal we could agree on in a future vote. (MJ-slef = I've a list of things i'd like to work on during the hackfest, will send it to you tomorrow) -- Paul POULAIN http://www.biblibre.com Expert en Logiciels Libres pour l'info-doc Tel : (33) 4 91 81 35 08
participants (8)
-
Chris Cormack -
Chris Nighswonger -
Dobrica Pavlinusic -
Jared Camins-Esakov -
Jonathan Druart -
Paul Poulain -
Robin Sheat -
Tomas Cohen Arazi