function printRequestLine
printRequestLine(
connection: HttpRequest,
palette: Theme,
now: number
): string

One connection on one line, for a list of them: 2m ago #3 200 GET /api/users.

The status wears its ground the way it does everywhere else, the verb its own colour, and the age is yellow while it is still recent — which is what a log is scanned for.

Age rather than a clock time, because "did I send that before or after I changed the header" is the question a request log is read to answer, and a wall-clock timestamp makes you do the subtraction yourself.

import { printRequestLine } from './print-request.ts';

const plain = { painter: () => (text: string) => text };
const request = { verb: 'GET', url: 'http://x/y', headers: new Map(), body: null };
const line = printRequestLine({ id: 1, request, response: null, failed: 'refused', ms: 1,
  at: Date.now() }, plain, Date.now());
line.includes('GET'); // true

Parameters

connection: HttpRequest
palette: Theme
now: number

Return Type

string

Usage

import { printRequestLine } from "lib/commands/repl/print-request.ts";