Skip to end of metadata
Go to start of metadata

$pluginloglevel = LBSystem::pluginloglevel();

 This function returns the currently set plugin loglevel, that the user has set in the plugin management.

LoxBerry 1.0.3

This function is available starting with LoxBerry V1.0.3. If you use that function, set this minimum version in your plugin.cfg.

With this function you can access the users set loglevel for your plugin in the plugin management. Therefore, you do not need to implement an own setting of loglevel or debug mode in your plugin. To show the loglevel setting to the user, you have to enable the custom log setting in plugin.cfg by CUSTOM_LOGLEVELS=true.

The function returns a loglevel between 0 and 7. They follow the severity levels of LoxBerry in common, and are documented here: plugindatabase.dat. In short, level 7=DEBUG, level 3=ERROR and level 0=EMERGE, that can be equaled to "Off".

Usage

require_once "loxberry_system.php";
 
$level = LBSystem::pluginloglevel();
if ($level >= 3) {
	echo "An error occured";
}
if ($level == 7) {
	echo "A debugging message";
}
  • No labels