roundcube / roundcubemail

The Roundcube Webmail suite
https://roundcube.net
GNU General Public License v3.0
5.88k stars 1.64k forks source link

How do I use the console() function with the debug_logger plugin? #8041

Closed sdondley closed 3 years ago

sdondley commented 3 years ago

I read the documentation at the top of debug_logger.php and have enable the plugin and a log is created by the plugin so I know it's working.

But I'm confused where the comment explains how to use the console() funciton:

 * index.php (just after $RCMAIL->plugins->init()):
 *
 *   console("my test","start");
 *   console("my message");
 *   console("my sql calls","start");
 *   console("cp -r * /dev/null","shell exec");
 *   console("select * from example","sql");
 *   console("select * from example","sql");
 *   console("select * from example","sql");
 *   console("end");
 *   console("end");

First, I can't find $RCMAIL->plugins->init() anywhere in the code. Second, I've tried adding console calls to a few different locations but they all result in 500 errors.

sdondley commented 3 years ago

Here is the line in index.php containing $RCMAIL->plugins->init() https://github.com/roundcube/roundcubemail/blob/cc97ea0559af1a92a54dbcdf738ee4d95e67d3ff/index.php#L40

But this is the state of index.php back in 2009 when the debug_logger plugin was introduced.

So the documentation is out of date and I could not figure out how to get the plugin to work as outlined in the documentation. I think the plugin is badly out of date.

alecpl commented 3 years ago

These days it is rcube::console().

alecpl commented 3 years ago

Beside what I mentioned above, the plugin was indeed broken. Looks no-one is really using it.

Anyway, i should be fixed now in master.

sdondley commented 3 years ago

Thank you. The plugin works as advertised now.