Method Debug
- Namespace
- WhalesSecret.TradeScriptLib.API
- Assembly
- WhalesSecret.TradeScriptLib.dll
Debug(EventCategory, string, ChartInformation?, string, params object?[])
Raises a debug severity event in the trade script, which is sent to the Core application and can be consumed by the user.
bool Debug(EventCategory category, string id, ChartInformation? chartInformation, string message, params object?[] args)
Parameters
category
EventCategoryCategory of the raised event. This must not be set to TradeSystem.
id
stringIdentifier of the event assigned to it by the originating trade script. This should be a short string that may help to identify the event, such as an event code. It must not be longer than MaxEventIdLength.
chartInformation
ChartInformationOptionally, information about visualization of the event on the chart.
message
stringEvent message in markdown which may contain composite formatting items. Final markdown message string must not be longer than MaxEventMessageLength.
args
object[]If
message
contains composite formatting items, these are the format arguments.
Returns
- bool
If the trade script runs in the production mode, the return value is
true
in case the event was successfully created and inserted to the queue from which it will be sent to the Core application. The return value isfalse
in case of a formatting error or a violation of arguments constraints, or in case the event cannot be delivered.If the trade script runs in the debug mode, the method only returns
true
or it throws an exception in case of a failure.
Exceptions
- InvalidArgumentException
Thrown if the trade script runs in the debug mode and
id
or the message after being formatted exceed the maximum allowed length, or ifid
ormessage
isnull
, or ifcategory
is set to TradeSystem.- InvalidStateException
Thrown if the trade script runs in the debug mode and the event cannot be delivered.
Debug(EventCategory, string, string, params object?[])
Raises a debug severity event in the trade script, which is sent to the Core application and can be consumed by the user.
bool Debug(EventCategory category, string id, string message, params object?[] args)
Parameters
category
EventCategoryCategory of the raised event. This must not be set to TradeSystem.
id
stringIdentifier of the event assigned to it by the originating trade script. This should be a short string that may help to identify the event, such as an event code. It must not be longer than MaxEventIdLength.
message
stringEvent message in markdown which may contain composite formatting items. Final markdown message string must not be longer than MaxEventMessageLength.
args
object[]If
message
contains composite formatting items, these are the format arguments.
Returns
- bool
If the trade script runs in the production mode, the return value is
true
in case the event was successfully created and inserted to the queue from which it will be sent to the Core application. The return value isfalse
in case of a formatting error or a violation of arguments constraints, or in case the event cannot be delivered.If the trade script runs in the debug mode, the method only returns
true
or it throws an exception in case of a failure.
Exceptions
- InvalidArgumentException
Thrown if the trade script runs in the debug mode and
id
or the message after being formatted exceed the maximum allowed length, or ifid
ormessage
isnull
, or ifcategory
is set to TradeSystem.- InvalidStateException
Thrown if the trade script runs in the debug mode and the event cannot be delivered.