From 0cbd7877f495f24d269c348b54f6f9fdc5074946 Mon Sep 17 00:00:00 2001 From: Zach White Date: Sat, 27 Jan 2024 09:59:55 -0800 Subject: [PATCH] document custom loggers --- docs/metadata.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/metadata.md b/docs/metadata.md index ab035e1..3c57bf4 100644 --- a/docs/metadata.md +++ b/docs/metadata.md @@ -15,8 +15,16 @@ You should only do this once, and you should do it as early in your program's ex !!! danger Do not import `set_metadata` and `cli` at the same time! When you run `set_metadata` the `cli` object will be replaced, but your existing import will continue to reference the old `cli` object. -## Environment based setup +## Custom Loggers -Earlier versions of MILC used the environment variables `MILC_APP_NAME`, `MILC_APP_VERSION`, and `MILC_AUTHOR_NAME` to set this information. While this is supported in MILC 1.4.x it will throw a `DeprecationWarning` and will be removed in a later version of MILC. +You can also use this to pass in custom loggers. -You can supress this warning by setting the environment variable `MILC_IGNORE_DEPRECATED`. +```python +from milc import set_metadata + +from my_program import custom_logger + +set_metadata(logger=custom_logger) + +from milc import cli +```