logger

package
v0.0.0-...-507ffb6 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package logger wraps the galog configuration/initialization.

Index

Constants

View Source
const (

	// CloudLoggingLogID is the logId used for cloud logging for core plugin.
	CloudLoggingLogID = "GCEGuestAgent"

	// LocalLoggerIdent is the ident used for local loggers (i.e syslog), it is
	// shared between core plugin and guest agent - they both use the same
	// "name space".
	LocalLoggerIdent = "google_guest_agent"

	// CorePluginLogPrefix is a human readable prefix added to all log entries
	// identifying the core plugin.
	CorePluginLogPrefix = "CorePlugin"

	// ManagerCloudLoggingLogID is the logId used for cloud logging for plugin
	// manager.
	ManagerCloudLoggingLogID = "GCEGuestAgentManager"
	// ManagerLocalLoggerIdent is the ident used for local loggers (i.e syslog)
	// for plugin manager.
	ManagerLocalLoggerIdent = "google_guest_agent_manager"
	// ManagerLogPrefix is a human readable prefix added to all log entries for
	// plugin manager.
	ManagerLogPrefix = "GCEGuestAgentManager"
)

Variables

This section is empty.

Functions

func Init

func Init(ctx context.Context, opts Options) error

Init initializes the logger.

Types

type Options

type Options struct {
	// CloudIdent is the cloud logging logId attribute - or logName field.
	CloudIdent string
	// Ident is the application ident used across loggers.
	Ident string
	// ProgramVersion is the program version.
	ProgramVersion string
	// LogFile is the path of the log file.
	LogFile string
	// LogToStderr flags if stderr loggers must be enabled.
	LogToStderr bool
	// LogToCloudLogging flags if cloud logging loggers must be enabled.
	LogToCloudLogging bool

	// Level is the log level.
	Level int
	// Verbosity is the log verbosity level.
	Verbosity int
	// Prefix is a prefix tag appended to all log entries, it's passed down to
	// galog configuration.
	Prefix string
	// ACSClientDebugLogging is a flag to enable ACS client logging.
	ACSClientDebugLogging bool
	// contains filtered or unexported fields
}

Options contains the loggers configuration/options.

Jump to

Keyboard shortcuts

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