log.lua 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. return {
  2. tag = 'callbacks',
  3. summary = 'Called when a message is logged.',
  4. description = [[
  5. This callback is called when a message is logged. The default implementation of this callback
  6. prints the message to the console using `print`, but it's possible to override this callback to
  7. render messages in VR, write them to a file, filter messages, and more.
  8. The message can have a "tag" that is a short string representing the sender, and a "level"
  9. indicating how severe the message is.
  10. The `t.graphics.debug` flag in `lovr.conf` can be used to get log messages from the GPU driver
  11. (tagged as `GL`). It is also possible to emit your own log messages using `lovr.event.push`.
  12. ]],
  13. arguments = {
  14. {
  15. name = 'message',
  16. type = 'string',
  17. description = 'The log message. It may end in a newline.'
  18. },
  19. {
  20. name = 'level',
  21. type = 'string',
  22. description = 'The log level (`debug`, `info`, `warn`, or `error`).'
  23. },
  24. {
  25. name = 'tag',
  26. type = 'string',
  27. description = 'The log tag.'
  28. }
  29. },
  30. returns = {},
  31. related = {
  32. 'lovr.graphics.print'
  33. }
  34. }