Documentation ¶
Overview ¶
Package logging contains logging related functions used by multiple packages
Index ¶
- Constants
- func CallerStr(skip uint) string
- func GetFunctionAndSource(skip uint) (result []interface{})
- func GetGitRepoInfo(srcRepo *sourcev1.GitRepository) (result []interface{})
- func GetLayer(obj k8sruntime.Object) string
- func GetLayerInfo(src *kraanv1alpha1.AddonsLayer) (result []interface{})
- func GetObjKindNamespaceName(obj k8sruntime.Object) (result []interface{})
- func GetObjNamespaceName(obj k8sruntime.Object) (result []interface{})
- func GitRepoSourceKind() string
- func LayerKind() string
- func LogJSON(data interface{}) string
- func TraceCall(log logr.Logger)
- func TraceExit(log logr.Logger)
- type CallerInfo
Constants ¶
const ( Me = 3 MyCaller = 4 )
Variables ¶
This section is empty.
Functions ¶
func GetFunctionAndSource ¶
func GetFunctionAndSource(skip uint) (result []interface{})
GetFunctionAndSource gets function name and source line for logging
func GetGitRepoInfo ¶
func GetGitRepoInfo(srcRepo *sourcev1.GitRepository) (result []interface{})
GetGitRepoInfo gets GitRepository details for logging
func GetLayer ¶
func GetLayer(obj k8sruntime.Object) string
GetLayer gets layer, returning object name for AddonsLayer.kraan.io objects or owner name for others
func GetLayerInfo ¶
func GetLayerInfo(src *kraanv1alpha1.AddonsLayer) (result []interface{})
GetLayerInfo gets AddonsLayer details for logging
func GetObjKindNamespaceName ¶
func GetObjKindNamespaceName(obj k8sruntime.Object) (result []interface{})
GetObjKindNamespaceName gets object kind namespace and name for logging
func GetObjNamespaceName ¶
func GetObjNamespaceName(obj k8sruntime.Object) (result []interface{})
GetObjNamespaceName gets object namespace and name for logging
func GitRepoSourceKind ¶
func GitRepoSourceKind() string
GitRepoSourceKind returns the gitrepository kind
Types ¶
type CallerInfo ¶
CallerInfo hold the function name and source file/line from which a call was made
func Callers ¶
func Callers(levels uint, short bool) ([]CallerInfo, error)
Callers returns an array of strings containing the function name, source filename and line number for the caller of this function and its caller moving up the stack for as many levels as are available or the number of levels specified by the levels parameter. Set the short parameter to true to only return final element of Function and source file name.
func GetCaller ¶
func GetCaller(skip uint, short bool) CallerInfo
GetCaller returns the caller of GetCaller 'skip' levels back Set the short parameter to true to only return final element of Function and source file name