CodeIgniter Forums
Turned-Off Errors Showing Up In Error Log - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Turned-Off Errors Showing Up In Error Log (/showthread.php?tid=36742)



Turned-Off Errors Showing Up In Error Log - El Forum - 12-13-2010

[eluser]Bob Dog[/eluser]
I don't know if this would be considered a bug in CodeIgniter or not, but I will throw it out there for your judgement.

If I have error logging enabled via application/config/config.php:

$config['log_threshold'] = 1;

and I use the PHP convention to temporarily disable error messages (the "@" symbol):

<?php if (@$some_possibly_undefined_variable): ?>

then the error messages don't appear on the screen, but they still show up in the error log. I would really rather not have these messages which I have explicitly turned off cluttering up the error log.

What do you think?


Turned-Off Errors Showing Up In Error Log - El Forum - 12-13-2010

[eluser]WanWizard[/eluser]
@ does exactly what it says on the tin: it supresses the error message, it doesn't make the error go away.

Using @ is very expensive, and should be avoided where possible. Also, it's an indication of a not very clean programming style (to say it mildly), "possibly_undefined_variables" should not exist in your programs!