Prosody's logger library allows you to easily generate log messages, or catch such messages, possibly according to specified criteria.

Note: Prosody plugins already have a logger initialised for them… see "Developing modules: Logging".



Returns a log() function for the specified source. name may be any short descriptive string, preferably unique. Commonly it is the name of your module.


Accepts a function which will be used for output of all log messages. A writer function looks like this: