From 463bad4f9dc724bf087022df88c3130ab041ae00 Mon Sep 17 00:00:00 2001 From: Hubert depesz Lubaczewski Date: Wed, 27 Dec 2023 14:17:40 +0100 Subject: [PATCH] Add logging of bad plans Sometimes people complain about unparse-able plans. Let's see them. --- cpanfile | 1 - lib/Explain/Controller.pm | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cpanfile b/cpanfile index 15d33e9..272fa70 100644 --- a/cpanfile +++ b/cpanfile @@ -21,6 +21,5 @@ requires 'Mojolicious'; requires 'Pg::Explain', '>= 2.4'; requires 'Number::Bytes::Human'; requires 'Pg::SQL::PrettyPrinter'; -requires 'MojoX::Log::Rotate' # vim: set ft=perl: diff --git a/lib/Explain/Controller.pm b/lib/Explain/Controller.pm index 9f2c237..a55641d 100755 --- a/lib/Explain/Controller.pm +++ b/lib/Explain/Controller.pm @@ -249,7 +249,8 @@ sub index { if ( $EVAL_ERROR ) { # log message - $self->app->log->info( $EVAL_ERROR ); + $self->app->log->error( $EVAL_ERROR ); + $self->app->log->error( "Given plan: " . $plan ); # leave... return $self->render( 'message' => q|Failed to parse your plan:|, 'details' => $EVAL_ERROR );