set_log_level#
- kikuchipy.set_log_level(level: int | str)[source]#
Set level of kikuchipy logging messages.
- Parameters:
- level
Any value accepted by
logging.Logger.setLevel()
. Levels are"DEBUG"
,"INFO"
,"WARNING"
,"ERROR"
and"CRITICAL"
.
Notes
See https://docs.python.org/3/howto/logging.html.
Examples
Note that you might have to set the logging level of the root stream handler to display kikuchipy’s debug messages, as this handler might have been initialized by another package
>>> import logging >>> logging.root.handlers[0] <StreamHandler <stderr> (INFO)> >>> logging.root.handlers[0].setLevel("DEBUG")
>>> import kikuchipy as kp >>> kp.set_log_level("DEBUG") >>> s = kp.data.nickel_ebsd_master_pattern_small() >>> s.set_signal_type("EBSD") DEBUG:kikuchipy.signals._kikuchi_master_pattern:Delete custom attributes when setting signal type