Skip to content

WarningLog

Namespace: Vercel.AI.Operations

public static class WarningLog

Warning logger. Observer sees every call, including empty warning lists. Logger maps to globalThis.AI_SDK_LOG_WARNINGS.

Inheritance: object

View source

public static object? Logger { get; set; }

Custom logger. false suppresses logging. A delegate receives nonempty warnings.

Value: object

View source

public static Action<WarningLogContext>? Observer { get; set; }

Receives every log attempt, including an empty warning list.

Value: Action<WarningLogContext>

View source

Write(IReadOnlyList<OperationWarning>?, string?, string?)

Section titled “Write(IReadOnlyList<OperationWarning>?, string?, string?)”
public static void Write(IReadOnlyList<OperationWarning>? warnings, string? provider, string? model)

Records warnings for one model call.

Parameters

Name Type Description
warnings IReadOnlyList<OperationWarning>
provider string
model string

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product