Fix null writer

This commit is contained in:
luukas 2022-05-28 21:11:09 +03:00
parent b0e356f999
commit 7885b2c8f7
No known key found for this signature in database
GPG Key ID: CC4915E8D71FC044

View File

@ -6,5 +6,7 @@ logger = logging.getLogger(__name__)
class NullWriter:
def write(self, data):
if os.environ["CRAFTY_LOG_NULLWRITER"] == "true":
if os.environ.get("CRAFTY_LOG_NULLWRITER", "false") == "true":
logger.debug(data)
if os.environ.get("CRAFTY_PRINT_NULLWRITER", "false") == "true":
print(data)