log.lua 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  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 `GPU`). It is also possible to emit customlog messages using `lovr.event.push`, or
  12. by calling the callback.
  13. ]],
  14. arguments = {
  15. {
  16. name = 'message',
  17. type = 'string',
  18. description = 'The log message. It may end in a newline.'
  19. },
  20. {
  21. name = 'level',
  22. type = 'string',
  23. description = 'The log level (`debug`, `info`, `warn`, or `error`).'
  24. },
  25. {
  26. name = 'tag',
  27. type = 'string',
  28. description = 'The log tag.'
  29. }
  30. },
  31. returns = {},
  32. related = {
  33. 'Pass:text'
  34. }
  35. }