22848 Posts in 9653 Topics by 2803 members
|Go to End|
21 May 2010 at 4:19pm
How can I log data while I'm developing and testing? I don't necessarily want to display the data on screen, just log data basically. I'd love the ability to log entire objects and run tail -f error.log to see variable values etc. while I'm developing without messing up the display of the site.
21 May 2010 at 8:26pm Last edited: 21 May 2010 8:27pm
Hi Frank, Welcome to the forums
You can disable js validation by setting this in your _config.php file.
Logging data depends what version of SS your using. In 2.4 debug logging has a totally new setup you can use. Use the SS_Log class to write to a file. So first you define your writer in your config file.
Then you can write to the log.
SS_Log::log("This is something to log");
What you pass to that could be something like Debug::show($object) or a print_r($object) which will output the object or you can do specific values.
22 June 2010 at 5:28pm Last edited: 22 June 2010 7:13pm
Example of logging a basic message, need to pass Exception or an Array with following possible keys
SS_Log::log(new Exception('Some log message here'), SS_Log::NOTICE);
$message = array(
'errno' => '',
'errstr' => 'Testing',
'errfile' => '',
'errline' => '',
'errcontext' => ''
22 June 2010 at 6:07pm Last edited: 22 June 2010 7:05pm
Nothing to see here.
|Go to Top|