pyplusplus._logging_ package

Overview

defines logger classes

pyplusplus._logging_.create_handler(stream=None)
class pyplusplus._logging_.loggers

class-namespace, defines few loggers classes, used in the project

all
contains all logger classes, defined by the class
declarations

logger for declaration classes

This is very import logger. All important messages: problems with declarations, warnings or hints are written to this logger.

file_writer
logger for classes that write code to files
static make_inmemory()
module_builder

logger that in use by module_builder.module_builder_t class.

Just another logger. It exists mostly for Py++ developers.

root
root logger exists for your convenience only

Modules

multi_line_formatter

defines a class that helps to format user messages

class pyplusplus._logging_.multi_line_formatter.multi_line_formatter_t(fmt=None, datefmt=None, width=None)

Bases: logging.Formatter

Custom log formatter to split long message into several lines.

This formatter is used for the default stream handler that outputs its messages to stdout.

Constructor.

See the Python standard library reference for a documentation of fmt and datefmt. width is the maximum width of the generated text blocks.

format(record)

This method overwrites the original one.

The first thing, that is done in the original format() method, is the creation of the record.message attribute:

record.message = record.getMessage()

Now this method temporarily replaces the getMessage() method of the record by a version that returns a generated message that spans several lines. Then the original format() method is called which will invoke the ‘fake’ method.

static formatMessage(msgline, width=70)

Format a long single line message so that it is easier to read.

msgline is a string containing a single message. It can either be a plain message string which is reformatted using the textwrap module or it can be of the form <declaration>;<message> where <declaration> is the declaration string and <message> an arbitrary message. Lines of this form will be separated so that the declaration and the message appear in individual text blocks, where every line of message will start with ‘>’ character.

width is the maximum width of any text blocks (without indentation).

blog comments powered by Disqus

Table Of Contents

Previous topic

pyplusplus.utils package

Next topic

pyplusplus.creators_factory package

This Page