Skip to content

tjaniczek/react-native-log-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-log-manager

Capture React Native Metro logs via Chrome DevTools Protocol (CDP) — to stdout and/or a timestamped file.

Why? Metro's terminal output is noisy. This tool gives you a clean, filterable, color-coded log stream that persists to disk, with auto-reconnect so it survives RN restarts.

Usage

npx / bunx (no install)

npx github:tjaniczek/react-native-log-manager
bunx github:tjaniczek/react-native-log-manager

Clone & run

git clone https://github.com/tjaniczek/react-native-log-manager
cd react-native-log-manager
npm install
node index.js

Options

Flag Default Description
-o, --output <path> .logs/YYYY-MM-DD_HH-MM.txt Log file path
-p, --port <port> 8081 Metro debugger port
--host <host> localhost Metro host
--no-file false Stdout only, skip file
--filter <types> all Comma-separated: log,warn,error
--no-colors false Disable ANSI colors
-h, --help Show help

Key Bindings

Key Action
c Truncate (clear) current log file
r Reconnect to Metro
q / Ctrl+C Quit

Examples

# Stdout only
node index.js --no-file

# Only errors and warnings, custom output path
node index.js --filter error,warn --output /tmp/rn.txt

# Non-default Metro port
node index.js --port 8082

Features

  • Auto-reconnect — polls Metro every 3s if connection drops (survives RN/Metro restarts)
  • Color-coded output — errors red, warnings yellow, info cyan
  • Log file rotation warning — warns in status line when log file exceeds 10MB
  • Status line — live [connected] N logs | file: ... | c=clear r=reconnect q=quit
  • Object serialization — CDP object refs are resolved to JSON strings
  • Zero extra deps — only ws; CLI arg parsing via built-in node:util

About

Wrapper over Chrome debugger logs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors