How to read Pine logs: log.info and the filters
Updated
Pine Logs is where a script's log.info, log.warning and log.error messages land. It is the quickest way to see what a variable held on each bar. This guide adds a script that logs the close of every bar, then uses the filters to find a line.
Steps
- Code editor. Write a script that calls log.info. This one logs the close of every bar.
- Add to chart. Click Add to chart. Each call writes a log line.
- Logs tab. Open the Logs tab. Each row has the time, bar number, level and message.
- Pine logs. The INFO, WARNING and ERROR buttons show line counts. Click one to hide or show that level.
- Log search. Search keeps only the lines that contain your text.
- Clear logs. Clear empties the log. The next run fills it again.
Going to a bar
Click a log row to scroll the chart to the bar that wrote it. The number after the time is the bar index.
Levels and several scripts
log.infois blue,log.warningamber andlog.errorpink.- With more than one script on the chart a script column appears in each row, and a menu lets you show one script at a time.
Common mistakes
- A script that logs on every bar. Over thousands of bars the list is long. Use the search box; only the last 500 matching lines are drawn, and the panel says so.
- Looking at the wrong tab. The log is in the dock's Logs tab. If you closed it, bring it back from the windows icon in the rail.
Frequently asked questions
Does `log.info` work in every Pine version? The logging functions are for Pine v5 and v6 scripts.
Why is the log empty? Until a script calls log.info, log.warning or log.error the panel says "Nothing logged yet".
Related guides
This guide is replayed by an automated test on every release, so the steps here match the app as it is today.