mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 06:10:44 +08:00
Use more descriptive name for making log prefixes
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
This commit is contained in:
@@ -9,7 +9,7 @@ import { test as base, expect, type ViewportSize } from "@playwright/test";
|
||||
|
||||
import * as Process from "./process.js";
|
||||
import * as issue from "@tests/support/cobs/issue.js";
|
||||
import * as logLabel from "@tests/support/logLabel.js";
|
||||
import * as logLabel from "@tests/support/logPrefix.js";
|
||||
import * as patch from "@tests/support/cobs/patch.js";
|
||||
import { createOptions, supportDir, tmpDir } from "@tests/support/support.js";
|
||||
import { createPeerManager } from "@tests/support/peerManager.js";
|
||||
@@ -52,7 +52,7 @@ export const test = base.extend<{
|
||||
|
||||
forAllTests: [
|
||||
async ({ customAppConfig, outputLog, page }, use) => {
|
||||
const browserLabel = logLabel.make("browser");
|
||||
const browserLabel = logLabel.logPrefix("browser");
|
||||
page.on("console", msg => {
|
||||
// Ignore common console logs that we don't care about.
|
||||
if (
|
||||
@@ -111,7 +111,7 @@ export const test = base.extend<{
|
||||
});
|
||||
}
|
||||
|
||||
const playwrightLabel = logLabel.make("playwright");
|
||||
const playwrightLabel = logLabel.logPrefix("playwright");
|
||||
|
||||
function isLocalhost(url: URL) {
|
||||
return url.hostname === "localhost" || url.hostname === "127.0.0.1";
|
||||
|
||||
@@ -23,7 +23,7 @@ const availableColors: ColorName[] = [
|
||||
|
||||
const assignedColors: Record<string, ColorName> = {};
|
||||
|
||||
export function make(label: string): string {
|
||||
export function logPrefix(label: string): string {
|
||||
if (assignedColors[label] === undefined) {
|
||||
const color = availableColors.pop();
|
||||
if (!color) {
|
||||
@@ -5,7 +5,7 @@ import onExit from "exit-hook";
|
||||
import { StringDecoder } from "string_decoder";
|
||||
import { execa } from "execa";
|
||||
|
||||
import { make } from "./logLabel.js";
|
||||
import { logPrefix } from "./logPrefix.js";
|
||||
|
||||
// Processes that should be SIGKILLed when the Node process shutsdown.
|
||||
// We add all proxy and node instances that we spawn to this list.
|
||||
@@ -42,7 +42,7 @@ export function prefixOutput(
|
||||
label: string,
|
||||
output: Stream.Writable,
|
||||
): ExecaChildProcess {
|
||||
const pref = make(label);
|
||||
const pref = logPrefix(label);
|
||||
if (childProcess.stdout) {
|
||||
const stdoutPrefix = new LinePrefix(pref);
|
||||
childProcess.stdout.pipe(stdoutPrefix).pipe(output, { end: false });
|
||||
|
||||
Reference in New Issue
Block a user