Lines Matching defs:Logger
5 // Package log implements a simple logging package. It defines a type, Logger,
7 // Logger accessible through helper functions Print[f|ln], Fatal[f|ln], and
8 // Panic[f|ln], which are easier to use than creating a Logger manually.
9 // That logger writes to standard error and prints the date and time
12 // printed does not end in a newline, the logger will add one.
26 // These flags define which text to prefix to each log entry generated by the Logger.
43 LstdFlags = Ldate | Ltime // initial values for the standard logger
46 // A Logger represents an active logging object that generates lines of
48 // the Writer's Write method. A Logger can be used simultaneously from
50 type Logger struct {
58 // New creates a new Logger. The out variable sets the
62 func New(out io.Writer, prefix string, flag int) *Logger {
63 return &Logger{out: out, prefix: prefix, flag: flag}
66 // SetOutput sets the output destination for the logger.
67 func (l *Logger) SetOutput(w io.Writer) {
96 func (l *Logger) formatHeader(buf *[]byte, t time.Time, file string, line int) {
145 // Logger. A newline is appended if the last character of s is not
149 func (l *Logger) Output(calldepth int, s string) error {
176 // Printf calls l.Output to print to the logger.
178 func (l *Logger) Printf(format string, v ...interface{}) {
182 // Print calls l.Output to print to the logger.
184 func (l *Logger) Print(v ...interface{}) { l.Output(2, fmt.Sprint(v...)) }
186 // Println calls l.Output to print to the logger.
188 func (l *Logger) Println(v ...interface{}) { l.Output(2, fmt.Sprintln(v...)) }
191 func (l *Logger) Fatal(v ...interface{}) {
197 func (l *Logger) Fatalf(format string, v ...interface{}) {
203 func (l *Logger) Fatalln(v ...interface{}) {
209 func (l *Logger) Panic(v ...interface{}) {
216 func (l *Logger) Panicf(format string, v ...interface{}) {
223 func (l *Logger) Panicln(v ...interface{}) {
229 // Flags returns the output flags for the logger.
230 func (l *Logger) Flags() int {
236 // SetFlags sets the output flags for the logger.
237 func (l *Logger) SetFlags(flag int) {
243 // Prefix returns the output prefix for the logger.
244 func (l *Logger) Prefix() string {
250 // SetPrefix sets the output prefix for the logger.
251 func (l *Logger) SetPrefix(prefix string) {
257 // SetOutput sets the output destination for the standard logger.
264 // Flags returns the output flags for the standard logger.
269 // SetFlags sets the output flags for the standard logger.
274 // Prefix returns the output prefix for the standard logger.
279 // SetPrefix sets the output prefix for the standard logger.
284 // These functions write to the standard logger.
286 // Print calls Output to print to the standard logger.
292 // Printf calls Output to print to the standard logger.
298 // Println calls Output to print to the standard logger.
345 // Logger. A newline is appended if the last character of s is not