logging

package
v0.0.0-...-15e72af Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: MIT Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DATADOG_API_KEY string
View Source
var DATADOG_LOGS bool
View Source
var DATADOG_LOGS_URL string
View Source
var DATADOG_METRICS bool
View Source
var DATADOG_METRICS_URL string
View Source
var DATADOG_SERVICE_NAME string
View Source
var DATADOG_SOURCE string
View Source
var DATADOG_STAGE string
View Source
var DATADOG_VERSION string
View Source
var ERROR_FILE_LOCATION string

Initialize config variables

View Source
var LOCAL_LOGS bool
View Source
var LOCAL_LOGS_LOCATION string
View Source
var LOG_LEVEL string
View Source
var Log loggerWrapper

Initialize the global logger variable.

Functions

func InitLogger

func InitLogger(GlobalConfig *config.Config)

InitLogger initializes the global logger.

The function creates a new zap logger with the specified configuration and sets the global logger variable to the new logger.

Parameters:

  • GlobalConfig: The global configuration from the config package.

Types

type Config

type Config struct {
	ErrorFileLocation string
	LogLevel          string
	LocalLogs         bool
	LocalLogsLocation string
	DatadogLogs       bool
	DatadogSource     string
	DatadogStage      string
	DatadogVersion    string
	DatadogService    string
	DatadogAPIKey     string
	DatadogLogsURL    string
	DatadogMetrics    bool
	DatadogMetricsURL string
}

Config represents the configuration for the logging package.

type ContextKey

type ContextKey string

ContextKey defines the supported context keys.

const (
	InstructionGuid ContextKey = "instructionGuid"
	AdapterType     ContextKey = "adapterType"
	WatchFolderPath ContextKey = "watchFolderPath"
	WatchFilePath   ContextKey = "watchFilePath"
	ReaderGuid      ContextKey = "readerGuid"
	ClientGuid      ContextKey = "clientGuid"
	Action          ContextKey = "action"
	Rest_Call_Id    ContextKey = "restCallId"
	Rest_Call       ContextKey = "restCall"
	UserMail        ContextKey = "userMail"
)

type ContextMap

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

ContextMap represents a context for managing key-value pairs with specific context keys. It allows setting, retrieving, and copying context data associated with various keys.

func (*ContextMap) Copy

func (ctx *ContextMap) Copy() *ContextMap

Copy function copies the current contextMap so new uses of Set do not overwrite existing values

Returns:

  • *ContextMap: A copy of the current ContextMap.

func (*ContextMap) Get

func (ctx *ContextMap) Get(key ContextKey) (interface{}, bool)

Get function retrieves the value for a ContextKey

Parameters:

  • key: The ContextKey for which to retrieve the value.

Returns:

  • interface{}: The value associated with the specified ContextKey.
  • bool: A boolean indicating whether the ContextKey exists.

func (*ContextMap) Set

func (ctx *ContextMap) Set(key ContextKey, value interface{})

Set function sets ContextKeys equal to any value

type Metric

type Metric struct {
	Metric    string     `json:"metric"`
	Type      int        `json:"type"`
	Points    []Point    `json:"points"`
	Resources []Resource `json:"resources"`
}

Metric represents a time series metric.

type Metrics

type Metrics struct {
	Series []Metric `json:"series"`
}

Metrics represents a collection of metrics.

type Point

type Point struct {
	Timestamp int64   `json:"timestamp"`
	Value     float64 `json:"value"`
}

Point represents a data point in a time series metric.

type Resource

type Resource struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

Resource represents a named resource associated with a metric.

Jump to

Keyboard shortcuts

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