Skip to content

Create Context Manager for LogWriter #1

@RobinDeBaets

Description

@RobinDeBaets

By implementing the necessary methods for LogWriter, it can support the Context Manager syntax:

writer = LogWriter.with_datetime(folder="./", threshold=10)

# Do stuff

writer.flush()

would become

with LogWriter.with_datetime(folder="./", threshold=10) as writer:
    # Do stuff

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions