logging

package
v0.0.0-...-73b5b3b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2024 License: MIT Imports: 14 Imported by: 10

Documentation

Overview

Copyright (c) Microsoft Corporation. Licensed under the MIT License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCallStack

func GetCallStack() string

Types

type ExtensionLogger

type ExtensionLogger struct {
	// contains filtered or unexported fields
}

ExtensionLogger exposes logging capabilities to the extension It automatically appends time stamps and debug level to each message and ensures all logs are placed in the logs folder passed by the agent

func New

New creates a new logging instance. If the handlerEnvironment is nil, we'll use a standard output logger

func NewWithName

func NewWithName(he *handlerenv.HandlerEnvironment, logFileFormat string) *ExtensionLogger

Allows the caller to specify their own name for the file Supports cycling of logs to prevent filling up the disk

func (*ExtensionLogger) Close

func (logger *ExtensionLogger) Close()

Close closes the file

func (*ExtensionLogger) Error

func (logger *ExtensionLogger) Error(format string, v ...interface{})

Error logs an error. Format is the same as fmt.Print

func (*ExtensionLogger) ErrorFromStream

func (logger *ExtensionLogger) ErrorFromStream(prefix string, streamReader io.Reader)

Error logs an error. Get the message from a stream directly

func (*ExtensionLogger) Info

func (logger *ExtensionLogger) Info(format string, v ...interface{})

Info logs an information statement. Format is the same as fmt.Print

func (*ExtensionLogger) InfoFromStream

func (logger *ExtensionLogger) InfoFromStream(prefix string, streamReader io.Reader)

Info logs an information statement. Get the message from a stream directly

func (*ExtensionLogger) Warn

func (logger *ExtensionLogger) Warn(format string, v ...interface{})

Warn logs a warning. Format is the same as fmt.Print

func (*ExtensionLogger) WarnFromStream

func (logger *ExtensionLogger) WarnFromStream(prefix string, streamReader io.Reader)

Warn logs a warning. Get the message from a stream directly

type ILogger

type ILogger interface {
	StreamLogReader
	Error(format string, v ...interface{})
	Warn(format string, v ...interface{})
	Info(format string, v ...interface{})
	Close()
}

Target interface for Extentsion-Platform

type StreamLogReader

type StreamLogReader interface {
	ErrorFromStream(prefix string, streamReader io.Reader)
	WarnFromStream(prefix string, streamReader io.Reader)
	InfoFromStream(prefix string, streamReader io.Reader)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL