VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: vigier on September 09, 2012, 02:03:38 AM

Title: vmLogger doesn't work as described?
Post by: vigier on September 09, 2012, 02:03:38 AM
Hi,

I'd like to use vmLogger in VM 2.0.10. In calculationh.php I edited the code at line 1247:

public function calculateModificators(&$product, $variants) {
global $vmLogger;
$vmLogger->notice( 'My Notice to the user' );

$modificatorSum = 0.0;
//MarkerVarMods

I have debugmode on.
The error: "Fatal error: Call to a member function notice() on a non-object in C:\wamp\www\Joomla\administrator\components\com_virtuemart\helpers\calculationh.php on line 1249"

http://virtuemart.net/documentation/Developer_Manual/vmLogger.html says this is the way to do it... why doesn't it work?

Kind regards, Vigier
Title: Re: vmLogger doesn't work as described?
Post by: Milbo on September 09, 2012, 13:09:14 PM
Because in vm2 is no vmlogger, you must use vmdebug, please rtfm, http://dev.virtuemart.net/projects/virtuemart/wiki/Developing_a_module_or_plugin_for_VirtueMart_2
Title: Re: vmLogger doesn't work as described?
Post by: vigier on September 09, 2012, 13:15:54 PM
I first used the vmDebug, but that didn't work also (I just displayed the standard 6 lines with memory usage and stuff), that's why I tried this. Strange thing: I just restarted WampServer and Firefox and now the vmDebug works again...
Sorry for bothering you!

Regards, Vigier