Debugging

Scriptlogs, Profiler, Debug chips, chart Pins, diagnostics, and System Logs.

This page

Debugging

AXIS separates script-authored diagnostics (Pine log.*, engine errors, line timing) from shell telemetry (load, stream, engine connection).

Script Logs panel for last-run Pine log output

Writing-time and last-run info share four surfaces — hover, the param checklist, pre-eval, and debug chips — so each answer stays on its own chrome.

Abstract

SurfaceSource of truthOpen / toggle
HoverBuiltin / identifier docs (local corpus or LSP)Rest cursor on a symbol
Param checklistCall signature + remaining named argsType inside plot( / ta.sma( / …
Pre-eval / ProblemsParse/lint ∪ last-run engine errorsUnderlines + Problems (pre-eval vs run)
Scriptlogsstore.lastRunnormalizePyneLogsEditor header Scriptlogs
ProfilerprofilerEnabled + profile.linesEditor header Profiler
Debug chipsinlineDebugEnabled + last-run logs with lineEditor header Debug
PinsdebugPinsEnabled + logs with bar_index / timeEditor header Pins · Alt+P
System Logsstore.logs ring bufferStatus bar / logs strip
ModuleRole
ui/ScriptLogsPanel.tsxFloatable last-run log.* list
results/pyne-logs.tsNormalize / filter / TSV
results/profiler.tsLine % profile
results/inline-debug.tsAnnotations + pinable helpers
results/debug-pins.tsBar pins, markers, countDebugPins
editor/inline-debug.tsCM chips, pin gutter, line flash
editor/diagnostics.tsError underlines / gutter / jump
ui/EditorProblems.tsxProblems list UI
chart/manager-access.tsapplyDebugPinsToChart, jumpToDebugPin

Conceptual model

Diagram

Rendering…

Invariant: Scriptlogs / Debug / Pins never write into store.logs.


Four information surfaces

SurfaceWhenAnswers
HoverIdle on a symbolWhat is this builtin / identifier?
Param checklistInside a callWhich arguments remain?
Pre-evalWhile typing / SaveWhat is wrong before Run?
Debug chipsAfter Run, Debug onWhat did this source line log or error?

Hover and the param checklist never invent TradingView® host APIs — they read PYNE builtins / local docs. Pre-eval marks the buffer; Debug chips still read last run only.


Debug vs Pins

DebugPins
QuestionWhat happened on this source line?Which bar was that on the chart?
RequiresLine ref (line 12:, structured line, …)bar_index and/or time / bar_time
UIEnd-of-line chips + optional level gutterChart circle markers + 📍 editor gutter
ClickPin-able chips jump if bar info presentChip / 📍 / Scriptlogs → chart jump + line flash
StoreinlineDebugEnableddebugPinsEnabled

Workflow

  1. Add log.info / log.warning / log.error (or rely on engine errors) with line and ideally bar_index.
  2. Run.
  3. Toggle Debug to see chips; Pins to mark bars (count shows on the Pins button).
  4. Click a pin-able chip or 📍 → jumpToDebugPin (crosshair + scroll); source line flashes (cm-debug-pin-flash).

Both can be on at once. Pins without Debug still show 📍 gutter and chart markers.


Scriptlogs

Panel for script logging from the last run.

Pine callPanel level
log.infoinfo
log.warningwarning
log.errorerror

Open: Editor → Scriptlogs (axis-btn-scriptlogs). Pin-able rows jump to the chart when bar time/index is known.


Editor Profiler

Toggle Profiler (axis-btn-profiler):

  • Persists profilerEnabled
  • May send profiler: true to the engine
  • Header shows last-run ms
  • Gutter shows line % when profile.lines is present

Diagnostics & Problems

Independent of Debug chips: structural error reporting from pre-eval and the run payload.

  • Pre-eval (preeval*) marks parse / lint issues as you type; last-run adds engine error, meta.errors, diagnostics, error-level logs
  • CodeMirror underlines + severity gutter (larger hit target than line numbers)
  • Stats strip badge (axis-editor-diag-count) and Problems list (axis-editor-problems)
  • Each row shows origin pre-eval or run when the diagnostic has a source
  • Click → jump to line/range
  • Empty / in-flight pre-eval stays No problems (no checking flicker)

Scriptlogs vs System Logs

ScriptlogsSystem Logs
SourceScript log.* on last runAXIS shell events
StorelastRunstore.logs
UIFloatable ScriptlogsStrip above status bar
ControlEditor headerStatus bar

Persistence & test ids

KeyRole
panelChrome.scriptlogs / editorPanel chrome
profilerEnabledProfiler
inlineDebugEnabledDebug chips
debugPinsEnabledChart + pin gutter
testidRole
axis-btn-scriptlogsOpen Scriptlogs
axis-btn-profilerProfiler
axis-btn-inline-debugDebug
axis-btn-debug-pinsPins
axis-debug-pin-countPin count
axis-editor-diag-countDiagnostics badge
axis-editor-problemsProblems panel

Unit coverage: tests/pyne-logs.test.ts, tests/profiler.test.ts, tests/inline-debug.test.ts, tests/debug-pins.test.ts, tests/editor-diagnostics.test.ts.

See also