Module Expr Str ImportFrom alias alias alias alias alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias identifier ImportFrom alias Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad FunctionDef arguments args defaults kwarg body Expr Str Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args defaults kwarg body Expr Str Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults kwarg body Expr Str Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Str NameLoad NameLoad kwarg body Expr Str Assign NameStore Dict Str Str Str NameLoad NameLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str NameLoad NameLoad kwarg body Expr Str If NameLoad body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore AttributeLoad NameLoad attr orelse Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore TupleLoad NameLoad BoolOpOr NameLoad NameLoad Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str NameLoad NameLoad kwarg body Expr Str If NameLoad body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore AttributeLoad NameLoad attr orelse Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore TupleLoad NameLoad BoolOpOr NameLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad Num Str kwarg body Expr Str Assign NameStore BoolOpOr NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Str NameLoad NameLoad kwarg body Expr Str Assign NameStore IfExp NameLoad Str Str Assign NameStore IfExp NameLoad BinOpMod Str TupleLoad NameLoad NameLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults NameLoad kwarg body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore IfExp NameLoad TupleLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str BinOpMod Str Call AttributeLoad NameLoad attr Str Assign NameStore BinOpMod Str Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str ListLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore TupleLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore IfExp BoolOpOr NameLoad NameLoad TupleLoad NameLoad NameLoad NameLoad Return Call AttributeLoad NameLoad attr keyword NameLoad NameLoad decorator_list
N/A N/A 
pygogo.handlers
~~~~~~~~~~~~~~~

Log handlers

Examples:
    Add a stdout handler::

        >>> logger = logging.getLogger()
        >>> logger.addHandler(stdout_hdlr())
        >>> logger.info('hello world')
        hello world

Attributes:
    ENCODING (str): The module encoding
 __future__ absolute_import division print_function with_statement unicode_literals N/A sys N/A logging N/A socket os environ logging handlers hdlrs builtins * N/A ENCODING utf-8 N/A module_hdlr N/A N/A logging StreamHandler N/A sys stdout N/A module_logger N/A N/A logging getLogger __name__ N/A N/A N/A module_logger addHandler module_hdlr stdout_hdlr N/A N/A N/A kwargs N/A N/A A standard output log handler

    Returns:
        New instance of :class:`logging.StreamHandler`

    Examples:
        >>> stdout_hdlr()  # doctest: +ELLIPSIS
        <logging.StreamHandler object at 0x...>
     N/A N/A N/A logging StreamHandler N/A sys stdout N/A stderr_hdlr N/A N/A N/A kwargs N/A N/A A standard error log handler

    Returns:
        New instance of :class:`logging.StreamHandler`

    Examples:
        >>> stderr_hdlr()  # doctest: +ELLIPSIS
        <logging.StreamHandler object at 0x...>
     N/A N/A N/A logging StreamHandler N/A sys stderr N/A fileobj_hdlr N/A N/A f N/A kwargs N/A N/A A file object log handler

    Args:
        f (obj): A file like object.

    Returns:
        New instance of :class:`logging.StreamHandler`

    Examples:
        >>> from io import StringIO
        >>> fileobj_hdlr(StringIO())  # doctest: +ELLIPSIS
        <logging.StreamHandler object at 0x...>
     N/A N/A N/A logging StreamHandler f N/A file_hdlr N/A N/A filename mode encoding delay N/A a ENCODING False kwargs N/A N/A A file log handler

    Args:
        filename (string): The logfile name.

        mode (string): The file open mode (default: a, i.e., append).

        encoding (string): The file encoding (default: the module ENCODING).

        delay (bool): Defer file opening until the first call to emit
            (default: False).

    Returns:
        New instance of :class:`logging.FileHandler`

    Examples:
        >>> from tempfile import NamedTemporaryFile
        >>> f = NamedTemporaryFile()
        >>> file_hdlr(f.name)  # doctest: +ELLIPSIS
        <logging.FileHandler object at 0x...>
     N/A fkwargs N/A mode encoding delay mode encoding delay N/A N/A N/A logging FileHandler filename fkwargs N/A socket_hdlr N/A N/A host port tcp N/A localhost None False kwargs N/A N/A A socket log handler

    Args:
        host (string): The host name (default: localhost).

        port (int): The port (default: `logging.handlers` default).

        tcp (bool): Create a TCP connection instead of UDP (default: False).

    Returns:
        New instance of either :class:`logging.handlers.DatagramHandler` or
            :class:`logging.handlers.SocketHandler`

    Examples:
        >>> socket_hdlr()  # doctest: +ELLIPSIS
        <logging.handlers.DatagramHandler object at 0x...>
        >>> socket_hdlr(tcp=True)  # doctest: +ELLIPSIS
        <logging.handlers.SocketHandler object at 0x...>
     N/A tcp N/A N/A def_port N/A N/A logging handlers DEFAULT_TCP_LOGGING_PORT N/A handler N/A hdlrs SocketHandler N/A N/A def_port N/A N/A logging handlers DEFAULT_UDP_LOGGING_PORT N/A handler N/A hdlrs DatagramHandler N/A address N/A host N/A port def_port N/A N/A handler address N/A syslog_hdlr N/A N/A host port tcp N/A localhost None False kwargs N/A N/A A syslog log handler

    Args:
        host (string): The host name (default: localhost).

        port (int): The port (default: `logging.handlers` default).

        tcp (bool): Create a TCP connection instead of UDP (default: False).

    Returns:
        New instance of :class:`logging.handlers.SysLogHandler`

    Examples:
        >>> syslog_hdlr()  # doctest: +ELLIPSIS
        <logging.handlers.SysLogHandler object at 0x...>
     N/A tcp N/A N/A def_port N/A N/A logging handlers SYSLOG_TCP_PORT N/A socktype N/A socket SOCK_STREAM N/A N/A def_port N/A N/A logging handlers SYSLOG_UDP_PORT N/A socktype N/A socket SOCK_DGRAM N/A address N/A host N/A port def_port N/A N/A N/A hdlrs SysLogHandler address socktype socktype N/A buffered_hdlr N/A N/A target capacity level N/A None 4096 error kwargs N/A N/A A memory buffered log handler

    Args:
        target (obj): The target logger handler (default stdout).

        capacity (int): The buffer size (default 4096).

        level (string): The min event level required to flush buffer
            (default: error).

    Returns:
        New instance of :class:`logging.handlers.MemoryHandler`

    Examples:
        >>> buffered_hdlr()  # doctest: +ELLIPSIS
        <logging.handlers.MemoryHandler object at 0x...>
     N/A target N/A target N/A N/A logging StreamHandler N/A sys stdout N/A N/A N/A hdlrs MemoryHandler capacity N/A N/A level upper target N/A webhook_hdlr N/A N/A url host port get N/A localhost None False kwargs N/A N/A A web log handler

    Args:
        url (string): The logging endpoint.

        host (string): The host name (default: localhost).

        port (int): The port (default: None).

        get (bool): Use a GET request instead of POST (default: False).

    Returns:
        New instance of :class:`logging.handlers.HTTPHandler`

    Examples:
        >>> webhook_hdlr('api/log', 'mysite.com')  # doctest: +ELLIPSIS
        <logging.handlers.HTTPHandler object at 0x...>
     N/A method N/A get GET POST N/A host N/A port N/A %s:%s N/A host port host N/A N/A N/A hdlrs HTTPHandler host url method method N/A email_hdlr N/A N/A subject N/A None kwargs N/A N/A An email log handler

    Args:
        subject (str): The email subject (default: You've got mail.).

        kwargs(dict): Keyword arguments.

    Kwargs:
        host (str): The email server host (default: localhost).

        port (str): The email sever port (default: None).

        sender (str): The email sender (default: the system username at gmail).

        recipients (List[str]): The email recipients (default: the system
            username at gmail).

        username (str): The email sever username (default: None).

        password (str): The email sever password (default: None).

    Returns:
        New instance of :class:`logging.handlers.SMTPHandler`

    Examples:
        >>> email_hdlr('hello world')  # doctest: +ELLIPSIS
        <logging.handlers.SMTPHandler object at 0x...>
     N/A host N/A N/A kwargs get host localhost N/A port N/A N/A kwargs get port N/A address N/A port N/A host port host N/A sender N/A N/A kwargs get sender N/A %s@gmail.com N/A N/A environ get USER N/A def_recipient N/A %s@gmail.com N/A N/A environ get USER N/A recipients N/A N/A kwargs get recipients N/A def_recipient N/A subject N/A N/A kwargs get subject You've got mail N/A username N/A N/A kwargs get username N/A password N/A N/A kwargs get password N/A args N/A address sender recipients subject N/A credentials N/A N/A username password N/A username password None N/A N/A N/A hdlrs SMTPHandler credentials credentials args N/A