logs

package
v0.0.0-...-f374617 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AUDIT_LOG_HEAD = "ACTIVITY_CIM_"
	LogService     = "ACTIVITY_CIM_"
	AUDIT_LOG_Func = map[int]string{
		1: "ConfigUpdate",
	}
	ContainerID string
)

More loggers can be added if required For more dynamism it can even be initialized from main.

Functions

func GetContainerID

func GetContainerID()

GetContainerID get containerid from script

func InitializeLogInfo

func InitializeLogInfo(logLevel string, file_log bool)

func NewLogger

func NewLogger(fileName string) *lumberjack.Logger

Types

type KubeClient

type KubeClient struct {
	Client *kubernetes.Clientset
}

func NewKubeConfig

func NewKubeConfig() (*KubeClient, error)

NewKubeConfig get k8s client connection

type LogConfiguration

type LogConfiguration struct {
	StandardOutput bool     // true to print o/p on console. by dafault false. No console print
	LogFile        bool     // true to print to file. by default false.
	DateFormat     string   //  date format. Check time package for info
	TimeFormat     string   // Time format. Check time package for info
	TimeLocation   string   // Time and Date Location. time package ex: Asia/Kolkata
	Fd             *os.File // For file operations
	PrintException bool     // If true exception type will be printed. else not
	PrintError     bool     // If true error type will be printed. else not
	PrintWarning   bool     // If true Warning type will be printed. else not
	PrintInfo      bool     // If true Info  type will be printed. else not
	PrintDebug     bool     // If true Debug type will be printed. else not
}
var LogConf LogConfiguration

func (*LogConfiguration) Audit

func (lc *LogConfiguration) Audit(activity_functionality int, arg ...interface{})

func (*LogConfiguration) Debug

func (lc *LogConfiguration) Debug(arg ...interface{})

func (*LogConfiguration) Error

func (lc *LogConfiguration) Error(arg ...interface{})

func (*LogConfiguration) Exception

func (lc *LogConfiguration) Exception(arg ...interface{})

func (*LogConfiguration) Info

func (lc *LogConfiguration) Info(arg ...interface{})

func (*LogConfiguration) Warning

func (lc *LogConfiguration) Warning(arg ...interface{})

type LogLevel

type LogLevel int
const (
	LogLevelAll LogLevel = iota
	LogLevelDebug
	LogLevelInfo
	LogLevelWarning
	LogLevelError
	LogLevelException
)

Jump to

Keyboard shortcuts

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