Skip to content

LogWarnings

Namespace: Vercel.AI.Util

public static class LogWarnings

Logs provider warnings. Set Logger to false to suppress them, or to a delegate to replace the default emitter.

Inheritance: object

View source

public const string FirstWarningInfoMessage = "AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false."

Note emitted once before the first default warning.

Value: string

View source

public static Action<string>? ConsoleWarn { get; set; }

console.warn stand-in used when ProcessEmitWarning is null.

Value: Action<string>

View source

public static object? Logger { get; set; }

false suppresses warnings. A Action%601 receives them. null uses the default emitter.

Value: object

View source

public static Action<string, string, string?>? ProcessEmitWarning { get; set; }

Node process.emitWarning stand-in. Arguments are the message, the warning type, and the deprecation code (null for ordinary warnings). null falls back to ConsoleWarn.

Value: Action<string, string, string>

View source

public static void Log(LogWarningsOptions options)

Logs <code class=“paramref”>options</code> using the current logger settings.

Parameters

Name Type Description
options LogWarningsOptions

View source

public static void ResetState()

Clears the first-call note and the emitted deprecation codes so the next log emits them again.

View source

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