Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

681 B
Raw Blame
type LogcatRow = { timestamp?: string; level?: string; tag?: string; message?: string }

function isLogcatRow(value: unknown): value is LogcatRow {
  return typeof value === 'object' && value !== null
}

export function formatLogcat(value: unknown): string {
  const entries = Array.isArray(value) ? value.filter(isLogcatRow) : []
  if (entries.length === 0) {
    return 'No logcat output.'
  }
  return entries
    .map((entry) => {
      const prefix = [entry.timestamp, entry.level, entry.tag].filter(Boolean).join(' ')
      if (!prefix) {
        return entry.message ?? ''
      }
      return entry.message ? `${prefix}: ${entry.message}` : prefix
    })
    .join('\n')
}