source/utils/Logger.brs and provides three functions with distinct severity levels and different print conditions.
Logging functions
GTV_Log — debug (dev builds only)
GTV_Log is compiled out entirely when IS_DEV_BUILD = false. The #if / #end if block is a BrightScript compile-time conditional — no runtime check, no overhead in production builds.
Used for: normal flow tracing, event samples, parsed counts, and anything you only need during development.
Example output:
GTV_Warn — warnings (always printed)
GTV_Warn always prints regardless of the IS_DEV_BUILD flag. Used for recoverable issues: auth retry logic, server failover, skipped parser entries, connectivity state transitions, and session check deferrals.
Example output:
GTV_Error — errors (always printed)
GTV_Error always prints. Used for unrecoverable failures: handshake failure, no reachable server, HTTP request errors.
Example output:
GTV_LayoutPrint — layout diagnostics
A special diagnostic print function defined inAppConstants.brs, used when LAYOUT_DIAG = true:
GTV_LayoutPrint always uses the [GTV][WARN][LayoutDiag] prefix and prints at warn level so it appears even in production builds when enabled. It is gated by the LAYOUT_DIAG flag in AppConstants, not by IS_DEV_BUILD.
Example output:
Log level summary
| Function | Prefix | Prints in production | Prints in dev |
|---|---|---|---|
GTV_Log | [GTV][<tag>] | No | Yes |
GTV_Warn | [GTV][WARN][<tag>] | Yes | Yes |
GTV_Error | [GTV][ERROR][<tag>] | Yes | Yes |
GTV_LayoutPrint | [GTV][WARN][LayoutDiag] | Only if LAYOUT_DIAG=true | Only if LAYOUT_DIAG=true |
Enabling dev logging
Dev logging is controlled by theIS_DEV_BUILD bs_const in the manifest file:
GTV_Log output, change this to:
Setting
IS_DEV_BUILD=true increases log volume significantly. Every channel sample, every HTTP response code, every layout recalculation, and every ad poll result is printed. This can affect render-thread performance on lower-end Roku devices. Use dev builds only during development, not for channel submission packages.Viewing logs
Roku exposes the BrightScript debug console over Telnet on port 8085.print statements from the channel — including GTV_Log, GTV_Warn, and GTV_Error — appear here in real time.
Put the Roku in developer mode
Navigate to the Roku home screen and enter the developer mode sequence: Home × 3, Up × 2, Right, Left, Right, Left, Right. Enable the developer web server and note your device password.
Open the debug console
Diagnostic flags in AppConstants
BeyondIS_DEV_BUILD, three flags in AppConstants.brs enable additional diagnostic output at runtime (they can be toggled without changing IS_DEV_BUILD):
| Flag | Default | Effect |
|---|---|---|
LAYOUT_DIAG | false | Enables GTV_LayoutPrint calls; prints layout context values on every relayout. |
MAINSCREEN_GRID_DIAG | false | Enables extra logging inside the channel grid row calculations. |
ADS_FLOW_DIAG | false | Enables verbose ad polling flow logging via GTV_Warn (always visible). |
GTV_Warn level so they appear in both dev and production console sessions.