API reference / @evolu/common / Console

Console

📝 Cross-platform console

Console abstraction for Chrome 123+, Firefox 125+, Safari 18.1+, Node.js 22.x+, and React Native 0.75+. Includes methods guaranteed to be available in these environments and expected to remain compatible in future versions. Output formatting may vary (e.g., interactive UI in browsers vs. text in Node.js/React Native), but functionality is consistent across platforms.

Convention: Use a tag (e.g., [db]) as the first argument for log filtering.

Example

deps.console.log("[evolu]", "createEvoluInstance", { name });

Tip: In browser dev tools, you can filter logs by tag (e.g., [db]) to quickly find relevant messages. In Node.js, use grep to filter output:

node app.js | grep "\[relay\]"         # Show only relay logs
node app.js | grep -E "\[db\]|\[sql\]" # Show db and sql logs
node app.js | grep -v "\[debug\]"      # Hide debug logs

Or add to package.json scripts:

{
  "scripts": {
    "dev:relay": "node app.js | grep \"\\[relay\\]\"",
    "dev:db": "node app.js | grep -E \"\\[db\\]|\\[sql\\]\""
  }
}

Interfaces

InterfaceDescription
ConsoleCross-platform Console interface for Chrome 123+, Firefox 125+, Safari 18.1+, Node.js 22.x+, and React Native 0.75+
ConsoleConfig-
ConsoleDepDependency interface for injecting a Console instance.
ConsoleWithTimeConfig-

Functions

FunctionDescription
createConsoleCreates a console instance using the global console.
createConsoleWithTimeCreates a console instance with timestamp prefixes.

Was this page helpful?