use constant LOG_DEBUG => 70; use constant LOG_INFO => 60; use constant LOG_WARN => 50; use constant LOG_NONE => 0; . . # LOG_LEVEL is set to the desired LOG_* constant, to # determine the amount of logging detail use constant LOG_LEVEL => LOG_DEBUG; . . . # logging statements like this, throughout the code.... if ( LOG_LEVEL >= LOG_DEBUG ) { # do some logging here }