Skip to content

Copy of logger with binded data #1

@kivio

Description

@kivio

Make possible to copy logger with binded data.

Example better describe what i mean

log = logging.get_logger('test1')
log.debug('msg1')
# > msg1
log.bind(test=True)
log.debug('msg2')
# > msg2 with extra {'test': True}
log2 = log.bind(url='http://example.com', user='kivio')
# or if possible
# log2 = log.copy()
log2.debug('msg3')
# > msg3 with extra {'url': http://example.com', 'user': 'kivio', 'test': True}
log.debug('msg4')
# > msg4 with extra {'test': True}

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions