On Sep 23, 2:46 pm, Jean-Michel Pichavant <jeanmic...@sequans.com>
wrote:
> I personally use the following pattern:
>
> In any submodule moduleA.py of an application:
>
> import MyApp
> _logger =logging.getLogger(MyApp.logger.name + '.moduleA') # attach my
> logger to MyApp logger

It's also common to use the pattern

logger = logging.getLogger(__name__)

which will use the name of the module for a logger name, correctly
getting the name of subpackages and submodules when used therein.

Regards,

Vinay Sajip
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to