Skip to content

Remove root logger configuration #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 19, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pydantic2ts/cli/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
except ImportError:
GenericModel = None

logging.basicConfig(level=logging.DEBUG, format="%(asctime)s %(message)s")

logger = logging.getLogger("pydantic2ts")


Expand Down Expand Up @@ -223,6 +221,8 @@ def main(module: str, output: str, json2ts_cmd: str = "json2ts") -> None:
"""
CLI entrypoint to run :func:`generate_typescript_defs`
"""
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s %(message)s")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving this here makes it so calling pydantic2ts will still print debug logs but importing generate_typescript_defs won't print by default

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Doing the work for me AND teaching me something very useful/relevant, I can't ask for more than that 😛

But I do really appreciate it, and your solution makes sense -- merging this in now and then I'll release it along with a few other minor changes


return generate_typescript_defs(module, output, json2ts_cmd)


Expand Down