Skip to content

The "RealTimeLog" plugin allows you to remotely debug an application built on the Solar2d engine in Google Spreadsheets.

License

Notifications You must be signed in to change notification settings

stalker-66/RealTimeLog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RealTimeLog

Overview

The "RealTimeLog" plugin allows you to remotely debug an application built on the Solar2D engine in Google Spreadsheets.

Project Settings

To use this plugin, add an entry into the plugins table of build.settings.

settings = 
{
	android =
	{
		usesPermissions =
		{
			"android.permission.INTERNET",
			"android.permission.WRITE_EXTERNAL_STORAGE",
		},
	},

	plugins = {
		["plugin.realtimelog"] = { publisherId = "com.narkoz" },
	},
}

For Android, when using this plugin, don't forget to add the following permissions/features:

  • "android.permission.INTERNET"
  • "android.permission.WRITE_EXTERNAL_STORAGE"

Require

local realtimelog = require "plugin.realtimelog"

Functions

Initializes the realtimelog plugin. This call is required and must be executed before making other realtimelog calls.

realtimelog.init(params)

The params table includes parameters for realtimelog initialization.

  • deploymentID (required)
    String. Your Deployment ID. See more - How to get Deployment ID.
  • userID (optional)
    String. User ID for logging. Default is Device ID - system.getInfo( "deviceID" ) - Solar2D API.
  • timeUpdate (optional)
    Number. The delay in updating the log by the plugin in milliseconds. Default is 250 ms.
  • clearOldSession (optional)
    Boolean. Clearing the log on a new session. Default is false.
  • offlineLog (optional)
    Boolean. Saving the log to a file. If the app was closed before all logs were sent, a next launch of the app will resume sending old logs. Default is false.
  • debug (optional)
    Boolean. Includes additional debugging information for the plugin. Default is false.

Calling this function clears the log.

realtimelog.clear()

Plugin stop. After calling this function, initialization is required to work with the plugin.

realtimelog.stop()

Usage

The realtimelog plugin modifies the standard print function. You must use print in your app. The printout will be sent to the console and your Spreadsheet.
Example:

print( "My Test Print" )

Output:
Corona Simulator Console:
Make a copy You Spreadsheet:
Make a copy

The realtimelog plugin supports 3 types of messages:

  • Info - standard message on a white background. Default for all messages.
  • Warning - message on a yellow background.
  • Error - message on a red background.

To specify the message type you need to use the "@type=YOU_TYPE@" modifier. Where YOU_TYPE is the name of the message type.
Example:

print( "@type=Info@My message about Info" )
print( "@type=Warning@My message about Warning" )
print( "@type=Error@My message about Error" )

Output:
Corona Simulator Console:
Make a copy You Spreadsheet:
Make a copy

Extras

The print function now supports output lua tables.
Example:

local items = {
	{ id = "orange", count = 2, quality = "legend" },
	{ id = "banana", count = 8, quality = "legend" },
	{ id = "coconut", count = 14, quality = "legend" },
}
print( items )

Output:

  [{
    "id":"orange",
    "count":2,
    "quality":"legend"
  },{
    "id":"banana",
    "count":8,
    "quality":"legend"
  },{
    "id":"coconut",
    "count":14,
    "quality":"legend"
  }]

You can generate a unique id from your mask. Plugin initialization is optional.

local uniqueId = realtimelog.getUnic(mask)
  • mask (optional)
    String. The mask by which a unique identifier will be generated. Default is "xxxx-xxxx-xxxx".

Example:

local uniqueId = realtimelog.getUnic("xx-xx-xxxxxx-xx-xx")
print( uniqueId )

Output:

  "b8-40-1522f7-10-06"

Example

See more - Solar2dExample

Support

[email protected]

About

The "RealTimeLog" plugin allows you to remotely debug an application built on the Solar2d engine in Google Spreadsheets.

Resources

License

Stars

Watchers

Forks

Packages

No packages published