SYNOPSIS use Log::ger::Format 'Block'; use Log::ger; After that, you can use your logging routine a la Log::Contextual: # the following block won't run if debug is off log_debug { "the new count in the database is " . $rs->count }; To install only for current package: use Log::ger::Format; BEGIN { Log::ger->set_for_current_package('Block') } use Log::ger; DESCRIPTION Caveat: you have to do this in the compile-time phase (like shown in Synopsis). SEE ALSO Log::ger Log::Contextual