LogWarnings
Namespace: Vercel.AI.Util
public static class LogWarningsLogs provider warnings. Set Logger to false to suppress them,
or to a delegate to replace the default emitter.
Inheritance: object
Fields
Section titled “Fields”FirstWarningInfoMessage
Section titled “FirstWarningInfoMessage”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
Properties
Section titled “Properties”ConsoleWarn
Section titled “ConsoleWarn”public static Action<string>? ConsoleWarn { get; set; }console.warn stand-in used when ProcessEmitWarning is null.
Value: Action<string>
Logger
Section titled “Logger”public static object? Logger { get; set; }false suppresses warnings. A Action%601 receives them.
null uses the default emitter.
Value: object
ProcessEmitWarning
Section titled “ProcessEmitWarning”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>
Methods
Section titled “Methods”Log(LogWarningsOptions)
Section titled “Log(LogWarningsOptions)”public static void Log(LogWarningsOptions options)Logs <code class=“paramref”>options</code> using the current logger settings.
Parameters
| Name | Type | Description |
|---|---|---|
options |
LogWarningsOptions |
ResetState()
Section titled “ResetState()”public static void ResetState()Clears the first-call note and the emitted deprecation codes so the next log emits them again.
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product