Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DATADOG_API_KEY string
var DATADOG_LOGS bool
var DATADOG_LOGS_URL string
var DATADOG_METRICS bool
var DATADOG_METRICS_URL string
var DATADOG_SERVICE_NAME string
var DATADOG_SOURCE string
var DATADOG_STAGE string
var DATADOG_VERSION string
var ERROR_FILE_LOCATION string
Initialize config variables
var LOCAL_LOGS bool
var LOCAL_LOGS_LOCATION string
var LOG_LEVEL string
var Log loggerWrapper
Initialize the global logger variable.
Functions ¶
func InitLogger ¶
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.