Module: lib-tde.logger

This module overrides the existing print function.

The new print function also logs everything to $HOME/.cache/tde/stdout.log This module describes the new api of the print function.

Assume you want to print something:

print("This is a print message")

This gets printed out to stdout and written to $HOME/.cache/tde/stdout.log

You can give the user one of four logtypes: error, warning, debug and info. The default logtype is info.

To get the logtype you must do the following:

local logger = require("lib-tde.logger")
print("This is an error"       , logger.error)
print("This is a warning"      , logger.warn)
print("This is a debug message", logger.debug)
print("This is an info message", logger.info) -- by default you can omit logger.info

Class Hierarchy

  • lib-tde.logger

Info:

  • Copyright: 2020 Tom Meyers
  • Author: Tom Meyers

Static module functions

lib-tde.logger.print (arg[, log_type[, number]]) The default lua print message is overridden

Object properties

error string Indicate that this print message is an error
warn string Indicate that this print message is a warning
debug string Indicate that this print message is a debug message
info string Indicate that this print message is an info message


Static module functions

lib-tde.logger.print (arg[, log_type[, number]])
The default lua print message is overridden

Parameters:

  • arg string The string to print
  • log_type enum The type of log message (optional)
  • number depth In case you print a table, show the table until a certain depth (optional)

Usage:

    -- Print the error message "hello"
     print("hello", logger.error)

Object properties

error string
Indicate that this print message is an error
warn string
Indicate that this print message is a warning
debug string
Indicate that this print message is a debug message
info string
Indicate that this print message is an info message
generated by LDoc 1.4.6 Build with 💜 By F0xedb Last updated 2021-05-21 03:30:15