Skip to content

potatojam/defold-share-log

Repository files navigation

Share Log for Defold

The extension writes all output data to the console and makes it possible to receive them as a string, or send them.

Installation

⚠️ For Defold version below 1.3.5 use Share Log 1.0.0 version https://github.com/potatojam/defold-share-log/archive/refs/tags/1.0.0.zip

You can use it in your own project by adding this project as a Defold library dependency. Open your game.project file and in the dependencies field add a link to the ZIP file of a specific release.

⚠️ For some functions, you need to use the share extension. https://github.com/britzl/defold-sharing

The game.project Settings

[share_log]
block_release_version = true
catch_promise_errors = true
force_html5_init = false
  • block_release_version - Disable record for release version.
  • catch_promise_errors - For html5 version. Records unhandled promise errors.
  • force_html5_init - For html5 version. Starts recording on page load, not extension. The extension is initialized a bit later. Ignored block_release_version parameter.

Lua API

For use the functions you need to require module:

local sharelog = require("sharelog.sharelog")

sharelog.get_log()

Return all log as string

sharelog.save_to_file([, name[, path]])

Save log to file. Return path as string. For html return empty string.

Parameters

  • name string|nil optional Name for file. Default sharelog
  • path string|nil optional Path to folder. Default sys.get_save_file("sharelog", name)

sharelog.share_to_email(email)

Share log to email where possible.

Parameters

  • email string required Email to send

sharelog.share_text()

Share log as text using share extension

sharelog.share_file()

Share file as text using share extension

sharelog.is_share_work()

Check if share extention is available Return boolean

Credits

Made by PotatoJam.

For example used:

Dirty Larry

License

MIT license.