Documentation
¶
Overview ¶
Copyright Axis Communications AB.
For a full list of individual contributors, please see the commit history.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ETOSLogger ¶
type ETOSLogger struct {
// contains filtered or unexported fields
}
func New ¶
func New(opts zap.Options) *ETOSLogger
New creates a new ETOSLogger with the provided zap.Options. It adds default values to the options if they are not already set.
func (*ETOSLogger) Start ¶
func (l *ETOSLogger) Start(ctx context.Context) context.Context
Start initializes logcores and creates a new zap.Logger with the combined cores. It then adds the logger to the context and returns it.
func (*ETOSLogger) WithConsole ¶
func (l *ETOSLogger) WithConsole() *ETOSLogger
WithConsole adds a console core to the logger that writes to the destination writer specified in the options.
func (*ETOSLogger) WithOtel ¶
func (l *ETOSLogger) WithOtel(tracer *opentelemetry.ETOSTracer) *ETOSLogger
WithOtel adds an OpenTelemetry core to the logger if the provided tracer has a LoggerProvider.
func (*ETOSLogger) WithUserLog ¶
func (l *ETOSLogger) WithUserLog(publisher messaging.Publisher) *ETOSLogger
WithUserLog adds a user log core to the logger that writes to the provided messaging.Publisher. If the publisher is nil, it does not add the user log core.