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 AppName set. This function is used to associate a specific application name with a context, allowing for context-aware operations or logging.

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 set.