Код: Выделить всё
def info(msg):
caller_name = ????
print '[%s] %s' % (caller_name, msg)
Код: Выделить всё
import foo
foo.info('Hello') # => [myapp.bar] Hello
Подробнее здесь: https://stackoverflow.com/questions/109 ... -in-python
Код: Выделить всё
def info(msg):
caller_name = ????
print '[%s] %s' % (caller_name, msg)
Код: Выделить всё
import foo
foo.info('Hello') # => [myapp.bar] Hello