Package pyamf :: Module logging

[hide private]
[frames] | no frames]

# Source Code for Module pyamf.logging

     1  # Copyright (c) 2007-2009 The PyAMF Project.
     2  # See LICENSE for details.
     3
     4  """
     5  Logging utilities.
     6
     7  @since: 0.2.0
     8  """
     9
    10  logging = __import__('logging')
    11
    12 -def _get_instance_name(obj):
    13      return "%s.%s.0x%x" % (
    14          obj.__class__.__module__, obj.__class__.__name__, id(obj))
    15
    16 -def class_logger(cls):
    17      return logging.getLogger('%s.%s' % (cls.__module__, cls.__name__))
    18
    19 -def instance_logger(instance):
    20      return logging.getLogger(_get_instance_name(instance))
    21