I have seen enough incorrect usage of labels for storing application settings that I am going to document an appropriate solution that uses a Hierarchy custom setting object to control application logic.
Hierarchy Custom Setting for Log Settings
<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
<customSettingsType>Hierarchy</customSettingsType>
<enableFeeds>false</enableFeeds>
<fields>
<fullName>Enable_Log__c</fullName>
<defaultValue>false</defaultValue>
<description>When checked, logging is enabled</description>
<externalId>false</externalId>
<label>Enable Logging</label>
<trackTrending>false</trackTrending>
<type>Checkbox</type>
</fields>
<label>Log Settings</label>
<visibility>Public</visibility>
</CustomObject>
Your Class
// get the settings for the current user
LogSettings__c logSettings = LogSettings__c.getInstance();
// check the value and run if it has been enabled
if (logSettings.Enable_Log__c == true) {
//Initialize Log params
logging goes in here
}
Unit Test
static testMethod void yourTest(){
// create the setting record to enable logging "org wide"
LogSettings__c logSettings = LogSettings__c.getOrgDefaults();
logSettings.Enable_Log__c = true;
upsert logSettings;
Test.startTest();
// call your class and log some things
Test.stopTest();
// assert that your logger logged what you expected
}