log reference
Script log output, capped by your data plan and visible while the script runs.
Script log output, capped by your data plan and visible while the script runs.
log.debug
log.debug(message: string) -> voidWrites a debug-level message to the script log.
message is the text to write and cannot be null. Use this for messages that help you develop or debug a script.
Your data plan limits the number of log messages. Messages beyond the limit are dropped, and the number dropped is reported.
Example
script "conf"
data chart = subscribe(data.ohlcv)
on chart.update {
log.debug(str.format("close={0}", chart.close ?? 0.0))
}log.info
log.info(message: string) -> voidWrites an info-level message to the script log.
message is the text to write and cannot be null. Use this for normal script events you want to record.
Your data plan limits the number of log messages. Messages beyond the limit are dropped, and the number dropped is reported.
Example
script "conf"
data chart = subscribe(data.ohlcv)
on chart.close {
log.info("period confirmed")
}log.warn
log.warn(message: string) -> voidWrites a warning-level message to the script log.
message is the text to write and cannot be null. Use this for unexpected conditions that the script can handle.
Your data plan limits the number of log messages. Messages beyond the limit are dropped, and the number dropped is reported.
Example
script "conf"
data chart = subscribe(data.ohlcv)
on chart.update {
if chart.volume == null {
log.warn("missing volume row")
}
}log.error
log.error(message: string) -> voidWrites an error-level message to the script log.
message is the non-null text to write at the highest log severity.
Writing an error message does not stop the script. Log volume is capped by
your data plan. Messages beyond the cap are dropped, and the number dropped
is reported.
Example
script "conf"
data chart = subscribe(data.ohlcv)
on chart.update {
if (chart.close ?? 0.0) <= 0.0 {
log.error("bad close value")
}
}