Saltearse al contenido

lib/effects/logger

Esta página aún no está disponible en tu idioma.

Defined in: studiocms/packages/studiocms/src/lib/effects/logger.ts:67^

new S48Logger(logging: LogOptions, label: string): S48Logger

Defined in: studiocms/packages/studiocms/src/lib/effects/logger.ts:71^

LogOptions

string

S48Logger

label: string;

Defined in: studiocms/packages/studiocms/src/lib/effects/logger.ts:69^

options: LogOptions;

Defined in: studiocms/packages/studiocms/src/lib/effects/logger.ts:68^

debug(message: string): void

Defined in: studiocms/packages/studiocms/src/lib/effects/logger.ts:92^

string

void

error(message: string): void

Defined in: studiocms/packages/studiocms/src/lib/effects/logger.ts:89^

string

void

fork(label: string): S48Logger

Defined in: studiocms/packages/studiocms/src/lib/effects/logger.ts:79^

Creates a new logger instance with a new label, but the same log options.

string

S48Logger

info(message: string): void

Defined in: studiocms/packages/studiocms/src/lib/effects/logger.ts:83^

string

void

warn(message: string): void

Defined in: studiocms/packages/studiocms/src/lib/effects/logger.ts:86^

string

void

Defined in: studiocms/packages/studiocms/src/lib/effects/logger.ts:29^

level: LoggerLevel;

Defined in: studiocms/packages/studiocms/src/lib/effects/logger.ts:30^

type LoggerLevel = "debug" | "info" | "warn" | "error" | "silent";

Defined in: studiocms/packages/studiocms/src/lib/effects/logger.ts:19^

const errorTap: any;

Defined in: studiocms/packages/studiocms/src/lib/effects/logger.ts:267^

A utility function that logs an error message when an Effect.fail() is executed.

This function is curried and can be used in two forms:

  1. By providing a message first, which returns a function that takes an Effect and logs the error message.
  2. By providing both the Effect and the message directly.

The type of the success value of the Effect.

The type of the error value of the Effect.

The type of the environment required by the Effect.

The error message to log. Can be a single value or an array of values.

The Effect to which the error logging will be applied.

A new Effect that logs the provided error message when executed.


const levels: Record<LoggerLevel, number>;

Defined in: studiocms/packages/studiocms/src/lib/effects/logger.ts:21^


const pipeLogger: any;

Defined in: studiocms/packages/studiocms/src/lib/effects/logger.ts:210^

Wraps an Effect with additional logging functionality.

This function applies a runtime logger and a log span to the provided Effect, enabling detailed logging for debugging and monitoring purposes.

A string label used to identify the log entries and span.

The Effect to be wrapped with logging functionality.

A new Effect that includes runtime logging and a log span.


const runtimeLogger: any;

Defined in: studiocms/packages/studiocms/src/lib/effects/logger.ts:194^

Creates a runtime logger effect transformer that applies a specific label to log messages and configures the logging behavior based on the provided log level.

A string label to associate with the logger for identifying log messages.

A higher-order function that takes an Effect and returns a new Effect with the logger configuration applied.

function genLogger(label: string): <Eff, AEff>(f: (resume: Adapter) => Generator<Eff, AEff, never>) => Effect<AEff, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect<_A, E, _R>>] ? E : never, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect<_A, _E, R>>] ? R : never>

Defined in: studiocms/packages/studiocms/src/lib/effects/logger.ts:232^

Generates a logger function that wraps an effectful generator function with logging capabilities.

string

A string label used to identify the logger.

Function

A function that takes a generator function f and returns an Effect.Effect instance.

The returned function accepts a generator function f that yields wrapped effects (YieldWrap<Effect.Effect>). It logs the execution of the generator function and its effects using the provided label.

Eff extends YieldWrap<Effect<any, any, any>>

AEff

(resume: Adapter) => Generator<Eff, AEff, never>

Effect<AEff, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect<_A, E, _R>>] ? E : never, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect<_A, _E, R>>] ? R : never>


function getEventPrefix(level: LoggerLevel, label?: string): any

Defined in: studiocms/packages/studiocms/src/lib/effects/logger.ts:40^

LoggerLevel

string

any