Skip to main content

WithAppName

Gets a new context with AppName set.

def WithAppName(
ctx: context.Context,
appName: string
) - > context.Context

Gets a new context with the application name set. This function is used to associate a specific application name with a context, which can be useful for logging, tracing, or other context-aware operations.

Parameters

NameTypeDescription
ctxcontext.ContextThe parent context to which the application name will be added.
appNamestringThe name of the application to associate with the context.

Returns

TypeDescription
context.ContextA new context derived from the input context, with the application name associated.