NewLogger (pulsarlog/logger.go)

milvus · pkg/streaming/walimpls/impls/pulsar/pulsarlog/logger.go · go · Apache-2.0
infra, tag:knn-classified

Wraps Pulsar client logger to integrate with Milvus logging system.

// Source: https://github.com/milvus-io/milvus | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
package pulsarlog

import (
	"context"

	plog "github.com/apache/pulsar-client-go/pulsar/log"

	"github.com/milvus-io/milvus/pkg/v3/mlog"
)

var _ plog.Logger = (*logger)(nil)

// NewLogger creates a new pulsar logger.
// TODO: currently, pulsar client will log a huge message when logging,
// so we only log the first msg without format the log.
func NewLogger() plog.Logger {
	return &logger{mlog.With(mlog.FieldComponent("pulsar"))}
}

type logger struct {
	inner *mlog.Logger
}

func (l *logger) SubLogger(fields plog.Fields) plog.Logger {
	return &logger{l.inner.With(exportFields(fields).

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key