Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions sdk/src/main/java/com/relaypro/sdk/Relay.java
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,23 @@ public void logMessage( String message, String category) {
}
}

/**
* Log a debug message that is visible with the CLI command
* `relay workflow debug`. This is helpful for debugging workflows.
* @param message what you want to appear in the log stream.
*/
@SuppressWarnings("unused")
public void debugLog( String message) {
logger.debug("Logging debug message");
Map<String, Object> req = RelayUtils.buildRequest(RequestType.DebugLog,
entry("content", message));
try {
sendRequest(req);
} catch (EncodeException | IOException | InterruptedException e) {
logger.error("Error logging message", e);
}
}

/**
* Switches on an LED at a particular index to a specified color.
* @param sourceUri the interaction URN.
Expand Down
1 change: 1 addition & 0 deletions sdk/src/main/java/com/relaypro/sdk/RequestType.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ enum RequestType {
// PowerOff("wf_api_device_power_off_request"),
Terminate("wf_api_terminate_request"),
LogAnalytics("wf_api_log_analytics_event_request"),
DebugLog("wf_api_debug_log_request"),
ResolveIncident("wf_api_resolve_incident_request"),
CreateIncident("wf_api_create_incident_request");

Expand Down