Open Source Content Management System

Version 1.2 of PHP midgard_connection method set_debuglevel

title
PHP midgard_connection method set_debuglevel
content
Set log verbosity level.

_void_ **set_debuglevel(level);**

[PHP midgard\_connection|midgard_connection] method __set\_debuglevel__ takes one parameter and may be called **statically**.

* level _string_

Available and usable levels:

* warn ( or warning)
* info
* message
* debug

The default _warn_ will produce only warning logs. _info_ and _message_ provides functions and method names be written to log file with additional messages produced by invoked functions. _debug_ produces function and method names and all SQL queries.

You may set debuglevel as many time as needed during runtime. Log level is limited to currently invoked application, even if more than one reuse the same configuration and underlying connection to the same database.

## Example


midgard_connection::set_debuglevel("info");

try
{
$object = midgard_person(123);
}
catch(midgard_error_exception $e)
{
echo "Failed to get object" . $e->getMessage();
}

$object->lastname = "Smith";

midgard_connection::set_debuglevel("debug");

if(!$object->update()) {

if(midgard_connection::get_error() = MGD_ERR_ACCESS_DENIED)
echo "You are not allowed to edit this document";
}

midgard_connection::set_debuglevel("warn")

?>

[PHP midgard\_connection|midgard_connection].
name
php_midgard_connection_method_set_debuglevel
topic
40
author
16
Designed by Nemein, hosted by Anykey