Does log_message() log the line number? |
Hey Guys,
I was just wondering. If I use the log_message function in CI 3 does it log the file name and the line number also? Thanks!
The log_message function only writes the log level, the date/time, and the message you supply to it. The Exceptions class passes the file name and line number to log_message when logging exceptions, though.
Do you mean PHP exceptions class or does codeigniter has its own exception class?
CodeIgniter 3 has its own CI_Exceptions class which is used by the exception handler configured during CI's bootstrap process.
What would be the difference if I use php native exceptions class or codeigniter exceptions class?
The CI_Exceptions class is called by the function which CI registers as the exception-handler to log and (if enabled) display the exception. Since it is registered with PHP's native exception-handling mechanism, CI's exception-handler expects any exception thrown by your application to use (or extend) the native PHP Exception class.
So, CI_Exceptions is not an Exception (or an extension of Exception), it is simply a collection of methods which handle errors and exceptions, and a property which defines the error/warning levels used by CI. |
Welcome Guest, Not a member yet? Register Sign In |