Skip to content

logging

[ allennlp.common.logging ]


AllenNlpLogger Objects#

class AllenNlpLogger(logging.Logger):
 | def __init__(self, name)

A custom subclass of 'logging.Logger' that keeps a set of messages to implement {debug,info,etc.}_once() methods.

debug_once#

 | def debug_once(self, msg, *args, **kwargs)

info_once#

 | def info_once(self, msg, *args, **kwargs)

warning_once#

 | def warning_once(self, msg, *args, **kwargs)

error_once#

 | def error_once(self, msg, *args, **kwargs)

critical_once#

 | def critical_once(self, msg, *args, **kwargs)

ErrorFilter Objects#

class ErrorFilter(Filter)

Filters out everything that is at the ERROR level or higher. This is meant to be used with a stdout handler when a stderr handler is also configured. That way ERROR messages aren't duplicated.

filter#

 | def filter(self, record)

prepare_global_logging#

def prepare_global_logging(
    serialization_dir: str,
    rank: int = 0,
    world_size: int = 1
) -> None