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

Transition print() statements in API to logging module #317

Open
ymahlich opened this issue Jan 30, 2025 · 0 comments
Open

Transition print() statements in API to logging module #317

ymahlich opened this issue Jan 30, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@ymahlich
Copy link
Collaborator

This specifically concerns the info print outs during download and loading:

Example in Download routine:

print(f"Downloaded '{file_url}' to '{file_name}'")

Example in cd.load() rountine:

print(f"Importing raw data ...", file=sys.stderr)

Those could be moved to logging routine for easier and more robust handling. See for example:

logger = logging.getLogger(__name__)

if args.LOGLEVEL == 'info':
loglevel = logging.INFO
elif args.LOGLEVEL == 'debug':
loglevel = logging.DEBUG
else:
loglevel = logging.WARNING
logging.basicConfig(
format="{asctime} - {levelname} - {message}",
style="{",
datefmt="%Y-%m-%d %H:%M",
level=loglevel
)

logger.info("importing datasets...")

@ymahlich ymahlich added the enhancement New feature or request label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

1 participant