• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Does log_message() log the line number?

#1
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!
Reply

#2
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.
Reply

#3
Do you mean PHP exceptions class or does codeigniter has its own exception class?
Reply

#4
CodeIgniter 3 has its own CI_Exceptions class which is used by the exception handler configured during CI's bootstrap process.
Reply

#5
What would be the difference if I use php native exceptions class or codeigniter exceptions class?
Reply

#6
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.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.