Skip to content
This repository has been archived by the owner on Jun 9, 2018. It is now read-only.

Commit

Permalink
Merge pull request bcit-ci#2440 from vlakoff/develop
Browse files Browse the repository at this point in the history
Logging functions: level parameter is not optional
  • Loading branch information
narfbg committed May 17, 2013
2 parents e418e1e + d0c30ab commit f755cfd
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions system/core/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,12 +424,12 @@ function show_404($page = '', $log_error = TRUE)
* We use this as a simple mechanism to access the logging
* class and send messages to be logged.
*
* @param string
* @param string
* @param bool
* @param string the error level: 'error', 'debug' or 'info'
* @param string the error message
* @param bool whether the error is a native PHP error
* @return void
*/
function log_message($level = 'error', $message, $php_error = FALSE)
function log_message($level, $message, $php_error = FALSE)
{
static $_log, $_log_threshold;

Expand Down
4 changes: 2 additions & 2 deletions system/core/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@ public function __construct()
*
* Generally this function will be called using the global log_message() function
*
* @param string the error level
* @param string the error level: 'error', 'debug' or 'info'
* @param string the error message
* @param bool whether the error is a native PHP error
* @return bool
*/
public function write_log($level = 'error', $msg, $php_error = FALSE)
public function write_log($level, $msg, $php_error = FALSE)
{
if ($this->_enabled === FALSE)
{
Expand Down
2 changes: 1 addition & 1 deletion tests/mocks/core/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ function &is_loaded()

if ( ! function_exists('log_message'))
{
function log_message($level = 'error', $message, $php_error = FALSE)
function log_message($level, $message, $php_error = FALSE)
{
return TRUE;
}
Expand Down
6 changes: 3 additions & 3 deletions user_guide_src/source/general/common_functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ please see the :doc:`Error Handling <errors>` documentation.
log_message()
=============

.. php:function:: log_message($level = 'error', $message, $php_error = FALSE)
.. php:function:: log_message($level, $message, $php_error = FALSE)
:param string $level: Log level
:param string $level: Log level: 'error', 'debug' or 'info'
:param string $message: Message to log
:param bool $php_error: Whether we're loggin a native PHP error message
:param bool $php_error: Whether we're logging a native PHP error message
:returns: void

This function is an alias for ``CI_Log::write_log()``. For more info,
Expand Down
6 changes: 3 additions & 3 deletions user_guide_src/source/general/errors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ optional second parameter to FALSE will skip logging.
log_message()
=============

.. php:function:: log_message($level = 'error', $message, $php_error = FALSE)
.. php:function:: log_message($level, $message, $php_error = FALSE)
:param string $level: Log level
:param string $level: Log level: 'error', 'debug' or 'info'
:param string $message: Message to log
:param bool $php_error: Whether we're loggin a native PHP error message
:param bool $php_error: Whether we're logging a native PHP error message
:returns: void

This function lets you write messages to your log files. You must supply
Expand Down

0 comments on commit f755cfd

Please sign in to comment.