Skip to content
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

Use sgqlc for graphql requests #181

Merged
merged 7 commits into from
Mar 11, 2023
Merged

Use sgqlc for graphql requests #181

merged 7 commits into from
Mar 11, 2023

Conversation

reconman
Copy link
Collaborator

Also move most python files out of root directory

@reconman reconman merged commit 6d1628d into master Mar 11, 2023
@reconman reconman deleted the graphql-refactor branch March 11, 2023 04:48
Comment on lines +1 to +8
import logging
from typing import Tuple


class PrefixLoggerAdapter(logging.LoggerAdapter):
""" A logger adapter that adds a prefix to every message """
def process(self, msg: str, kwargs: dict) -> Tuple[str, dict]:
return (f'[{self.extra["prefix"]}] ' + msg, kwargs)

Choose a reason for hiding this comment

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

In a private repo I have something along the lines of:

import logging
import sys

FORMAT = "%(asctime)s-%(levelname)s -- %(filename)s -- %(message)s"
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG, format=FORMAT)
logger = logging.getLogger()

I guess you could have better control over the logging by using the FORMAT option of the logger?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants