Skip to main content

Differences from Python logging

Although this library is based on the Python logging library, it is not meant to be a full re-implementation. There are key differences as a result of Roblox's sandbox, and the result is a significantly less complex module.

Record Messages

Record content should always be strings. The Python library provides additional flexibility.

Exception Logging

Lua does not have a native object that represents an error; it simply deals in strings. As such, Logger:exception does not exist.

Thread Safety

Roblox does not support true multithreading, so there is no mechanism (or need) to serialize access to underlying I/O functionality on handlers. This library was did not need to be designed with thread safety in mind.

Handler Limitations

Stream or File Handlers

Roblox does not provide access to the file system, so this library does not include record handlers which work with files, such as: WatchedFileHandler, RotatingFileHandler, or TimedRotatingFileHandler

Socket Handlers

Roblox does not provide access to sockets, which excludes SocketHandler, DatagramHandler, and SMTPHandler. Serializing/deserializing objects is often done using JSON; Lua does not have a pickle equivalent.

System Event Handlers

Roblox does not provide access to operating system level logging, so SysLogHandler and NTEventLogHandler are out.