CC-Logging provides a simple API for logging in ComputerCraft Lua that is based of Lua Logging. It currently supports logging to a function and to a file. Both can be provided by the user. The file should be closed after use automatically.

The documentation can be found here.

Usage example:

os.loadAPI("logging")
local logger = logging.new{func = function(self, level, message)
  print(level..": "..message)
end,
file = "log.log"}

logger:info("Opened log file")

Download:
The file can be fetched from my Github repo here or from pastebin: LeNqT36Q

If you have any questions, feel free to ask them here.

You can use this wherever you want, but it would be nice if you give me credit.