Last active
December 29, 2019 08:36
-
-
Save zhangzhhz/f31ce5f34404f9a4c570680b81b0b24c to your computer and use it in GitHub Desktop.
Using python logging module, one can change logging level of a imported module that also uses python logging. In this snippet, the last line (commented out) disables MSAL DEBUG logs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import msal | |
# Optional logging | |
formatter = '%(asctime)s - %(name)s - %(levelname)s - %(message)s' | |
# logging.basicConfig(format=formatter, level=logging.DEBUG) # Enable DEBUG log for entire script | |
logging.basicConfig(format=formatter) # initialte logging | |
logger = logging.getLogger(__name__) | |
logger.setLevel(logging.DEBUG) | |
# logging.getLogger("msal").setLevel(logging.INFO) # Optionally disable MSAL DEBUG logs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment