Skip to content

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

@ymahlich

Description

@ymahlich

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...")

Metadata

Metadata

Assignees

Labels

Projects

Status

No status

Relationships

None yet

Development

No branches or pull requests

Issue actions