spdaly
spdaly

Reputation: 1260

Magento Debugging Environment

I looked for ideas on setting up a Magento development environment when we first started using it for our site last year. I didn't find anything that work really well, so I stayed with var_dump'ing using the log files.

Now that Magento has another year under its belt and several hundred more developers I was wondering if anyone has found a better solution for debugging Magento.

We use Eclipse as our development environment. We tried a pre-2.0 release of PDT with the Zend Debugger and didn't have much luck.

Upvotes: 8

Views: 5249

Answers (7)

Alana Storm
Alana Storm

Reputation: 166046

I use a combination of var_dump with xDebug and Magento's Mage::Log method. Mage::Log is particularly nice, as it'll do some auto-expanding and pretty printing of objects if you pass them in (I'm not sure if that's the logger, or just Magento's __toString implementation).

If I'm on my local development box I use Console.app to keep an eye on the log file, otherwise it's a simple

tail -f /path/to/log/file

That combined with some custom modules I've built for debugging the config and layout keep me happy. (although I prefer a light weight text editor toolchain vs. the One True IDE tool chain, so your results may vary)

Upvotes: 4

Mufaddal
Mufaddal

Reputation: 5381

NuSphere is also good debugger for magento here is link NuSphere

Upvotes: 0

Mario
Mario

Reputation: 522

Give it a try to Magneto-Debug: https://github.com/madalinoprea/magneto-debug (only for dev environments).

Video doesn't contain features added in the latest version: http://www.youtube.com/watch?v=aqvgrmebcu4 - display layout updates from DB - display blocks' rendering time

Upvotes: 0

clockworkgeek
clockworkgeek

Reputation: 37700

I also use FirePHP but find this extension easier.

Upvotes: 0

Manos Dilaverakis
Manos Dilaverakis

Reputation: 5869

How about using FirePHP?

http://ajzele.net/utilize-firebug-and-firephp-to-speed-up-magento-development

It made my life a hell of a lot easier.

Upvotes: 6

aland
aland

Reputation: 2004

$object->debug() is often quite helpful too, although it doesn't exist on all objects. Here are my most commonly logged statements:

Mage::log( $object->debug() )
Mage::log( $object->getData() )
Mage::log( get_class($object) )           # name of class
Mage::log( get_class_methods($object) )   # methods of class

Upvotes: 1

Greg
Greg

Reputation: 10360

logging $object->getData() rather than the $object itself is normally more useful, and everything built into Magento has it as a method (everything extends Varien_Object)

Upvotes: 3

Related Questions