File: log.go

package info (click to toggle)
golang-github-getsentry-sentry-go 0.40.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,900 kB
  • sloc: makefile: 85; sh: 21
file content (35 lines) | stat: -rw-r--r-- 783 bytes parent folder | download
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
package debuglog

import (
	"io"
	"log"
)

// logger is the global debug logger instance.
var logger = log.New(io.Discard, "[Sentry] ", log.LstdFlags)

// SetOutput changes the output destination of the logger.
func SetOutput(w io.Writer) {
	logger.SetOutput(w)
}

// GetLogger returns the current logger instance.
// This function is thread-safe and can be called concurrently.
func GetLogger() *log.Logger {
	return logger
}

// Printf calls Printf on the underlying logger.
func Printf(format string, args ...interface{}) {
	logger.Printf(format, args...)
}

// Println calls Println on the underlying logger.
func Println(args ...interface{}) {
	logger.Println(args...)
}

// Print calls Print on the underlying logger.
func Print(args ...interface{}) {
	logger.Print(args...)
}