MCPcopy Create free account
hub / github.com/angular/dev-infra / buildLogLevelFunction

Function buildLogLevelFunction

ng-dev/utils/logging.ts:60–74  ·  view source on GitHub ↗

Build an instance of a logging function for the provided level.

(
  loadCommand: () => Function,
  level: LogLevel,
  defaultColor: ((text: string) => string) | null,
)

Source from the content-addressed store, hash-verified

58}
59
60/** Build an instance of a logging function for the provided level. */
61function buildLogLevelFunction(
62 loadCommand: () => Function,
63 level: LogLevel,
64 defaultColor: ((text: string) => string) | null,
65) {
66 /** Write to stdout for the LOG_LEVEL. */
67 return (...values: unknown[]) => {
68 runConsoleCommand(
69 loadCommand,
70 level,
71 // For string values, apply the default color.
72 ...values.map((v) => (typeof v === 'string' && defaultColor ? defaultColor(v) : v)),
73 );
74 };
75}
76
77/**

Callers 1

logging.tsFile · 0.85

Calls 1

runConsoleCommandFunction · 0.85

Tested by

no test coverage detected