@@ -42,26 +42,30 @@ protected function _reportEvent($event, $config = array())
4242
4343 if (in_array ($ event , $ events ))
4444 {
45- $ message = '<div class="well"> ' ;
45+ $ output = '<div class="well"> ' ;
4646
4747 $ args = $ config ['message ' ]['parameters ' ];
48+
4849 array_unshift ($ args , $ config ['message ' ]['text ' ]);
49- $ message .= call_user_func_array (array ('JText ' , 'sprintf ' ), $ args );
50+
51+ $ message = call_user_func_array (array ('JText ' , 'sprintf ' ), $ args );
52+
53+ $ output .= $ message ;
5054
5155 if (isset ($ config ['new ' ]))
5256 {
5357 if ($ config ['new ' ]) {
54- $ message .= '<br/> ' . JText::_ ('LIB_CATCHER_ITEM_NEW ' );
58+ $ output .= '<br/> ' . JText::_ ('LIB_CATCHER_ITEM_NEW ' );
5559 } else {
56- $ message .= '<br/> ' . JText::_ ('LIB_CATCHER_ITEM_NOT_NEW ' );
60+ $ output .= '<br/> ' . JText::_ ('LIB_CATCHER_ITEM_NOT_NEW ' );
5761 }
5862 }
5963
6064 if ($ this ->params ->get ('show_data ' ) && ($ data = $ this ->_renderData ($ config ['data ' ])))
6165 {
6266 $ signature = sprintf ('%s_%s ' , $ event , md5 ($ data . microtime ()));
6367
64- $ message .= '<br/><div class="panel-group" id="accordion">
68+ $ output .= '<br/><div class="panel-group" id="accordion">
6569 <div class="panel panel-default">
6670 <div class="panel-heading">
6771 <h5 class="panel-title" style="margin: 0px;">
@@ -74,14 +78,19 @@ protected function _reportEvent($event, $config = array())
7478 <div id=" ' . $ signature . '" class="panel-collapse collapse">
7579 <div class="panel-body" style="word-break: break-all;"> ' ;
7680
77- $ message .= $ data ;
81+ $ output .= $ data ;
7882
79- $ message .= '</div></div></div></div> ' ;
83+ $ output .= '</div></div></div></div> ' ;
8084 }
8185
82- $ message .= '</div> ' ;
86+ $ output .= '</div> ' ;
87+
88+ JFactory::getApplication ()->enqueueMessage ($ output , 'warning ' );
8389
84- JFactory::getApplication ()->enqueueMessage ($ message , 'warning ' );
90+ // Add a log entry.
91+ jimport ('joomla.log.log ' );
92+ JLog::addLogger (array ('text_file ' => 'catcher.php ' ), JLog::ALL , array ('catcher ' ));
93+ JLog::add (strip_tags ($ message ), JLog::DEBUG , 'catcher ' );
8594 }
8695 }
8796
@@ -139,4 +148,4 @@ protected function _renderData($data, $level = 0)
139148
140149 return $ output ;
141150 }
142- }
151+ }
0 commit comments