### Get otelzap Version Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap Retrieves the current release version of the otelzap bridge. ```go const Version = "0.19.0" ``` -------------------------------- ### Create New Core Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap Creates a new zapcore.Core for OpenTelemetry logging. The name parameter should be the package import path. This core can be used with go.uber.org/zap.New. ```go func NewCore(name string, opts ...Option) *Core ``` -------------------------------- ### NewCore Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap%40v0.19.0 Creates a new zapcore.Core that sends logging records to OpenTelemetry. The name should be the package import path. ```APIDOC ## NewCore ### Description Creates a new zapcore.Core that can be used with go.uber.org/zap.New. The name should be the package import path that is being logged. The name is ignored for named loggers created using go.uber.org/zap.Logger.Named. ### Method func NewCore(name string, opts ...Option) *Core ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) * **Core** (*Core) - A new zapcore.Core instance. #### Response Example None ``` -------------------------------- ### Core.Write Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap Encodes zap fields to OTel logs and emits them. ```APIDOC ## func (*Core) Write ### Description Write method encodes zap fields to OTel logs and emits them. ### Signature ```go func (o *Core) Write(ent zapcore.Entry, fields []zapcore.Field) error ``` ``` -------------------------------- ### WithVersion Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap Returns an Option that configures the version of the log.Logger used by a Core. ```APIDOC ## func WithVersion ### Description WithVersion returns an Option that configures the version of the log.Logger used by a Core. ### Signature ```go func WithVersion(version string) Option ``` ``` -------------------------------- ### Core.With Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap Adds structured context to the Core. ```APIDOC ## func (*Core) With ### Description With adds structured context to the Core. ### Signature ```go func (o *Core) With(fields []zapcore.Field) zapcore.Core ``` ``` -------------------------------- ### Configure LoggerProvider Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap Returns an Option that sets the log.LoggerProvider used by the Core. If not provided, the global LoggerProvider is used by default. ```go func WithLoggerProvider(provider log.LoggerProvider) Option ``` -------------------------------- ### Configure Version for Logger Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap Use WithVersion to set the version of the package being logged. This option helps in tracking and identifying the specific version of the software emitting log records. ```go func WithVersion(version string) Option ``` -------------------------------- ### WithVersion Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap Configures the version of the log.Logger. The version should be the version of the package that is being logged. ```APIDOC ## WithVersion ### Description Configures the version of the log.Logger used by a Core. The version should be the version of the package that is being logged. ### Function Signature ```go func WithVersion(version string) Option ``` ``` -------------------------------- ### Core Option Interface Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap Defines the interface for configuring a Core. Options are used during Core creation. ```go type Option interface { // contains filtered or unexported methods } ``` -------------------------------- ### NewCore Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap Creates a new zapcore.Core that sends logging records to OpenTelemetry. The name should be the package import path that is being logged. The name is ignored for named loggers created using go.uber.org/zap.Logger.Named. ```APIDOC ## func NewCore ### Description Creates a new zapcore.Core that can be used with go.uber.org/zap.New. The name should be the package import path that is being logged. The name is ignored for named loggers created using go.uber.org/zap.Logger.Named. ### Signature ```go func NewCore(name string, opts ...Option) *Core ``` ``` -------------------------------- ### Configure Version for OTelzap Logger Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap%40v0.19.0 Use WithVersion to set the version of the package being logged by the OTelzap logger's Core. This option helps in tracking the version of the software emitting the logs. ```go func WithVersion(version string) Option { return func(c *config) { c.version = version } } ``` -------------------------------- ### WithLoggerProvider Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap Returns an Option that configures log.LoggerProvider used by a Core to create its log.Logger. By default if this Option is not provided, the Handler will use the global LoggerProvider. ```APIDOC ## func WithLoggerProvider ### Description WithLoggerProvider returns an Option that configures log.LoggerProvider used by a Core to create its log.Logger. By default if this Option is not provided, the Handler will use the global LoggerProvider. ### Signature ```go func WithLoggerProvider(provider log.LoggerProvider) Option ``` ``` -------------------------------- ### Configure Schema URL for OTelzap Logger Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap%40v0.19.0 Use WithSchemaURL to set the semantic convention schema URL for the OTelzap logger's Core. This option is useful when adhering to specific semantic convention versions for log records. ```go func WithSchemaURL(schemaURL string) Option { return func(c *config) { c.schemaURL = schemaURL } } ``` -------------------------------- ### Core.Check Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap Determines whether the supplied Entry should be logged. If the entry should be logged, the Core adds itself to the CheckedEntry and returns the result. ```APIDOC ## func (*Core) Check ### Description Check determines whether the supplied Entry should be logged. If the entry should be logged, the Core adds itself to the CheckedEntry and returns the result. ### Signature ```go func (o *Core) Check(ent zapcore.Entry, ce *zapcore.CheckedEntry) *zapcore.CheckedEntry ``` ``` -------------------------------- ### Core.Sync Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap Flushes buffered logs (if any). ```APIDOC ## func (*Core) Sync ### Description Sync flushes buffered logs (if any). ### Signature ```go func (*Core) Sync() error ``` ``` -------------------------------- ### WithSchemaURL Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap Returns an Option that configures the schema URL of the log.Logger used by a Core. ```APIDOC ## func WithSchemaURL ### Description WithSchemaURL returns an Option that configures the schema URL of the log.Logger used by a Core. ### Signature ```go func WithSchemaURL(schemaURL string) Option ``` ``` -------------------------------- ### Configure Schema URL for Logger Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap Use WithSchemaURL to set the semantic convention schema URL for the logger's Core. This option is useful for ensuring consistent semantic logging across different services. ```go func WithSchemaURL(schemaURL string) Option ``` -------------------------------- ### Add Contextual Fields Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap Adds structured context to the Core by accepting a slice of zapcore.Field. ```go func (o *Core) With(fields []zapcore.Field) zapcore.Core ``` -------------------------------- ### Define Core Structure Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap Represents the core structure for the otelzap bridge, which implements zapcore.Core. ```go type Core struct { // contains filtered or unexported fields } ``` -------------------------------- ### WithSchemaURL Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap Configures the semantic convention schema URL of the log.Logger. The schemaURL should be the schema URL for the semantic conventions used in log records. ```APIDOC ## WithSchemaURL ### Description Configures the semantic convention schema URL of the log.Logger used by a Core. The schemaURL should be the schema URL for the semantic conventions used in log records. ### Function Signature ```go func WithSchemaURL(schemaURL string) Option ``` ``` -------------------------------- ### Check Log Entry Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap Determines if a log entry should be logged and adds the Core to the CheckedEntry if it should be logged. ```go func (o *Core) Check(ent zapcore.Entry, ce *zapcore.CheckedEntry) *zapcore.CheckedEntry ``` -------------------------------- ### Sync Logs Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap Flushes any buffered logs. This method is part of the zapcore.Core interface. ```go func (*Core) Sync() error ``` -------------------------------- ### WithAttributes Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap Returns an Option that configures the instrumentation scope attributes of the log.Logger used by a Core. ```APIDOC ## func WithAttributes ### Description WithAttributes returns an Option that configures the instrumentation scope attributes of the log.Logger used by a Core. ### Signature ```go func WithAttributes(attributes ...attribute.KeyValue) Option ``` ``` -------------------------------- ### Write Log Record Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap Encodes Zap fields into OpenTelemetry logs and emits them. This is the primary method for writing log records. ```go func (o *Core) Write(ent zapcore.Entry, fields []zapcore.Field) error ``` -------------------------------- ### Check Log Level Enabled Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap Determines whether a given logging level is enabled for the Core. ```go func (o *Core) Enabled(level zapcore.Level) bool ``` -------------------------------- ### Configure Instrumentation Scope Attributes Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap Returns an Option that sets the instrumentation scope attributes for the log.Logger used by the Core. Added in v0.11.0. ```go func WithAttributes(attributes ...attribute.KeyValue) Option ``` -------------------------------- ### Core.Enabled Source: https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelzap Decides whether a given logging level is enabled when logging a message. ```APIDOC ## func (*Core) Enabled ### Description Enabled decides whether a given logging level is enabled when logging a message. ### Signature ```go func (o *Core) Enabled(level zapcore.Level) bool ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.