Skip to content

Instantly share code, notes, and snippets.

@Guitaricet
Created June 16, 2022 15:41
Show Gist options
  • Save Guitaricet/013ac1461097112c1a48ee3ebc1d8b94 to your computer and use it in GitHub Desktop.
Save Guitaricet/013ac1461097112c1a48ee3ebc1d8b94 to your computer and use it in GitHub Desktop.
Good default logger
import os
import sys
import logging
logging.basicConfig(
format="%(asctime)s | %(levelname)s | %(name)s | %(message)s",
datefmt="%Y-%m-%d %H:%M:%S",
level=logging.INFO,
stream=sys.stdout,
)
logger = logging.getLogger(os.path.basename(__file__))
logging.getLogger("transformers.configuration_utils").setLevel(logging.WARNING)
logging.getLogger("wandb.sdk.internal.internal").setLevel(logging.WARNING)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment