Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
BiblioPixel provides an information and debug logging system via the built-in Python logging module. To enable the ability to turn built-in debugging information about the BiblioPixel classes, an internal wrapper located in bibliopixel.log.
To enable these debug messages, insert the following code at the top of your script:
from bibliopixel import log log.setLogLevel(log.DEBUG)
Doing so and running an animation will cause it to output the following on every step:
DEBUG - animation - 4ms/250fps / Frame: 2ms / Update: 2ms
The above is used for debugging animation/driver performance and breaks down as:
- DEBUG - Log level of the message.
- animation - Module the message originated from.
- 4ms/250fps - Total time (ms) the frame required / Effective frame rate.
- Frame: 2ms - Time required to render frame
- Update: 2ms - Time required to push frame to display.
The following log levels are available:
Calling log.setLogLevel() with one of these with cause all messages with that level, or higher, to be output. DEBUG being the lowest and CRITICAL being the highest. BiblioPixel defaults to INFO, which is used for basic system messages, if needed.
To output to the log, use the following methods:
For convenience, the ERROR and CRITICAL log messages are automatically placed on the stderr stream so that they can be more easily separated from normal output.