Skip to content
English

Console

The Console panel shows everything your app logs with console, as it happens. Logged objects can be expanded into a tree, and you can filter by level, search, and hide noisy entries.

Setting up Console in the SDK

The Console panel with log, info, warn and error entries and an expanded object

Each entry shows its Time, with milliseconds, its Type and its Details. Newest entries appear at the bottom. The list follows new output while you’re scrolled to the bottom; scroll up to stop, and use Jump to latest to go back. Drag a column edge to resize it, or double-click the edge to reset it.

The type comes from the console method:

Method Type
console.info info
console.warn warn
console.error, console.assert error
Any other method log

Xerlock adds two kinds of entry of its own:

  • success: “Connected to …” when the desktop app connects to your app, and “Reconnected to …” each time after that.
  • Navigation: “Navigated to …” on each screen change, when the navigation plugin is set up. These are hidden until you turn on the Navigation level.

Objects and arrays are copied when they’re logged, so later changes in your app don’t change what you see. Click a row with an object, or press Enter or Space, to expand it into a tree.

  • A Map shows its entries, and a Set shows its values as an array.
  • An Error shows its name, message and stack.
  • A reference back to an object it’s inside of shows as [Circular].
  • Objects are copied up to 8 levels deep and 500 entries each. Anything past that shows as {…}, […] or ….

Use Copy on a row to copy its objects as formatted JSON.

The levels are listed under Console in the sidebar. Click one to show or hide its entries. All levels are shown at first except Navigation, which is listed only when your app uses the navigation plugin. Your choice is saved between sessions.

Type in Filter logs… to show only the entries that contain the text. It matches the entry’s message and the contents of its objects, ignoring case. The time and type aren’t searched.

Use Exclude in the toolbar to hide entries you don’t want to see, such as a library’s repeated warnings. Each filter takes text or a /pattern/flags expression, matched the same way as the search, and an entry matching any of them is hidden. Switch a filter off to keep it for later, or edit or delete it. Filters are saved between sessions, and can also be managed in Settings > Filters.

The Exclude popover with a list of exclude filters

While any filter is active, a bar under the toolbar counts the entries it hides. Clear filters turns every level back on except Navigation, empties the search, and switches the exclude filters off without deleting them.

Use Show in context on a row to see it alongside your app’s native logs, ordered by time. See Seeing logs in context on the Native logs page.

Clear console empties the list in the desktop app. It doesn’t affect your app. Entries are kept when your app reloads or disconnects, until you clear them.

  • The Console keeps the latest 5,000 entries and drops older ones.
  • console.group, console.table and console.trace show as ordinary log entries, and console.clear() doesn’t clear the panel.
  • Entries don’t link to the source file. To see where an error came from, log the Error object and expand its stack.
  • If nothing appears, check the Connection panel. “No Metro found on port …” means Metro isn’t running, or runs on a port other than the one in Settings > Connection.