File: toplevel.go

package info (click to toggle)
incus 6.0.4-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 23,864 kB
  • sloc: sh: 16,015; ansic: 3,121; python: 456; makefile: 321; ruby: 51; sql: 50; lisp: 6
file content (70 lines) | stat: -rw-r--r-- 1,942 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package logger

import (
	"fmt"
)

// Trace logs a message (with optional context) at the TRACE log level.
func Trace(msg string, ctx ...Ctx) {
	Log.Trace(msg, ctx...)
}

// Debug logs a message (with optional context) at the DEBUG log level.
func Debug(msg string, ctx ...Ctx) {
	Log.Debug(msg, ctx...)
}

// Info logs a message (with optional context) at the INFO log level.
func Info(msg string, ctx ...Ctx) {
	Log.Info(msg, ctx...)
}

// Warn logs a message (with optional context) at the WARNING log level.
func Warn(msg string, ctx ...Ctx) {
	Log.Warn(msg, ctx...)
}

// Error logs a message (with optional context) at the ERROR log level.
func Error(msg string, ctx ...Ctx) {
	Log.Error(msg, ctx...)
}

// Panic logs a message (with optional context) at the PANIC log level.
func Panic(msg string, ctx ...Ctx) {
	Log.Panic(msg, ctx...)
}

// Tracef logs at the TRACE log level using a standard printf format string.
func Tracef(format string, args ...any) {
	Log.Trace(fmt.Sprintf(format, args...))
}

// Debugf logs at the DEBUG log level using a standard printf format string.
func Debugf(format string, args ...any) {
	Log.Debug(fmt.Sprintf(format, args...))
}

// Infof logs at the INFO log level using a standard printf format string.
func Infof(format string, args ...any) {
	Log.Info(fmt.Sprintf(format, args...))
}

// Warnf logs at the WARNING log level using a standard printf format string.
func Warnf(format string, args ...any) {
	Log.Warn(fmt.Sprintf(format, args...))
}

// Errorf logs at the ERROR log level using a standard printf format string.
func Errorf(format string, args ...any) {
	Log.Error(fmt.Sprintf(format, args...))
}

// Panicf logs at the PANIC log level using a standard printf format string.
func Panicf(format string, args ...any) {
	Log.Panic(fmt.Sprintf(format, args...))
}

// AddContext returns a new logger with the context added.
func AddContext(ctx Ctx) Logger {
	return Log.AddContext(ctx)
}