#!/usr/bin/env bash
# Show filtered app logs
source "$(cd "$(dirname "$0")/.." && pwd)/scripts/_config.sh"
filter="${1:-flexui|ascf|ascf-demo|EntryAbility|Index|createNode|updateNode|flush|firstView|FirstContentful|onJsException|STATUS|engine}"
log "Fetching app logs (filter: $filter)..."
# Also show domain 0x0002 (agent-runtime Logger) — 0x0001 is C++/flexui logs
hdc -t "$DEVICE" shell "hilog -x 2>/dev/null" 2>/dev/null | grep -iE "$filter" | tail -80 || true