Namespace: go.std.log
v1.0Contents
Summary
Provides a low-level interface to the log package.
Package log implements a simple logging package. It defines a type, Logger,
with methods for formatting output. It also has a predefined 'standard'
Logger accessible through helper functions Print[f|ln], Fatal[f|ln], and
Panic[f|ln], which are easier to use than creating a Logger manually.
That logger writes to standard error and prints the date and time
of each logged message.
Every log message is output on a separate line: if the message being
printed does not end in a newline, the logger will add one.
The Fatal functions call os.Exit(1) after writing the log message.
The Panic functions call panic after writing the log message.
Index
- *Logger
- Default
- Fatal
- Fatalf
- Fatalln
- Flags
- LUTC
- Ldate
- Llongfile
- Lmicroseconds
- Lmsgprefix
- Logger
- Lshortfile
- LstdFlags
- Ltime
- New
- Output
- Panic
- Panicf
- Panicln
- Prefix
- Printf
- Println
- SetFlags
- SetOutput
- SetPrefix
- Writer
- arrayOfLogger
Legend
-
Constant
Variable
Function
Macro
Special form
Type
GoVar
Receiver/Method
Constants
Constants are variables with :const true in their metadata. Joker currently does not recognize them as special; as such, it allows redefining them or their values.-
LUTC
Int v1.0if Ldate or Ltime is set, use UTC rather than the local time zone
-
Ldate
Int v1.0the date in the local time zone: 2009/01/23
-
Llongfile
Int v1.0full file name and line number: /a/b/c/d.go:23
-
Lmicroseconds
Int v1.0microsecond resolution: 01:23:23.123123. assumes Ltime.
-
Lmsgprefix
Int v1.0move the "prefix" from the beginning of the line to before the message
-
Lshortfile
Int v1.0final file name element and line number: d.go:23. overrides Llongfile
-
LstdFlags
Int v1.0initial values for the standard logger
-
Ltime
Int v1.0the time in the local time zone: 01:23:23
Variables
-
(None.)
Functions, Macros, and Special Forms
-
Default
Function v1.0(Default)
Default returns the standard logger used by the package-level output functions.
Go returns: *Logger
Joker input arguments: []
Joker returns: ^*Logger -
Fatal
Function v1.0(Fatal & v)
Fatal is equivalent to Print() followed by a call to os.Exit(1).
Go input arguments: (v ...any)
Joker input arguments: [& ^GoObject v] -
Fatalf
Function v1.0(Fatalf format & v)
Fatalf is equivalent to Printf() followed by a call to os.Exit(1).
Go input arguments: (format string, v ...any)
Joker input arguments: [^String format, & ^GoObject v] -
Fatalln
Function v1.0(Fatalln & v)
Fatalln is equivalent to Println() followed by a call to os.Exit(1).
Go input arguments: (v ...any)
Joker input arguments: [& ^GoObject v] -
Flags
Function v1.0(Flags)
Flags returns the output flags for the standard logger.
The flag bits are Ldate, Ltime, and so on.
Go returns: int
Joker input arguments: []
Joker returns: ^Int -
New
Function v1.0(New out prefix flag)
New creates a new Logger. The out variable sets the
destination to which log data will be written.
The prefix appears at the beginning of each generated log line, or
after the log header if the Lmsgprefix flag is provided.
The flag argument defines the logging properties.
Go input arguments: (out io.Writer, prefix string, flag int)
Go returns: *Logger
Joker input arguments: [^go.std.io/Writer out, ^String prefix, ^Int flag]
Joker returns: ^*Logger -
Output
Function v1.0(Output calldepth s)
Output writes the output for a logging event. The string s contains
the text to print after the prefix specified by the flags of the
Logger. A newline is appended if the last character of s is not
already a newline. Calldepth is the count of the number of
frames to skip when computing the file name and line number
if Llongfile or Lshortfile is set; a value of 1 will print the details
for the caller of Output.
Go input arguments: (calldepth int, s string)
Go returns: error
Joker input arguments: [^Int calldepth, ^String s]
Joker returns: ^Error -
Panic
Function v1.0(Panic & v)
Panic is equivalent to Print() followed by a call to panic().
Go input arguments: (v ...any)
Joker input arguments: [& ^GoObject v] -
Panicf
Function v1.0(Panicf format & v)
Panicf is equivalent to Printf() followed by a call to panic().
Go input arguments: (format string, v ...any)
Joker input arguments: [^String format, & ^GoObject v] -
Panicln
Function v1.0(Panicln & v)
Panicln is equivalent to Println() followed by a call to panic().
Go input arguments: (v ...any)
Joker input arguments: [& ^GoObject v] -
Prefix
Function v1.0(Prefix)
Prefix returns the output prefix for the standard logger.
Go returns: string
Joker input arguments: []
Joker returns: ^String -
Print
Function v1.0(Print & v)
Print calls Output to print to the standard logger.
Arguments are handled in the manner of fmt.Print.
Go input arguments: (v ...any)
Joker input arguments: [& ^GoObject v] -
Printf
Function v1.0(Printf format & v)
Printf calls Output to print to the standard logger.
Arguments are handled in the manner of fmt.Printf.
Go input arguments: (format string, v ...any)
Joker input arguments: [^String format, & ^GoObject v] -
Println
Function v1.0(Println & v)
Println calls Output to print to the standard logger.
Arguments are handled in the manner of fmt.Println.
Go input arguments: (v ...any)
Joker input arguments: [& ^GoObject v] -
SetFlags
Function v1.0(SetFlags flag)
SetFlags sets the output flags for the standard logger.
The flag bits are Ldate, Ltime, and so on.
Go input arguments: (flag int)
Joker input arguments: [^Int flag] -
SetOutput
Function v1.0(SetOutput w)
SetOutput sets the output destination for the standard logger.
Go input arguments: (w io.Writer)
Joker input arguments: [^go.std.io/Writer w] -
SetPrefix
Function v1.0(SetPrefix prefix)
SetPrefix sets the output prefix for the standard logger.
Go input arguments: (prefix string)
Joker input arguments: [^String prefix] -
Writer
Function v1.0(Writer)
Writer returns the output destination for the standard logger.
Go returns: io.Writer
Joker input arguments: []
Joker returns: ^go.std.io/Writer
Types
-
*Logger
Concrete Type v1.0A Logger represents an active logging object that generates lines of
output to an io.Writer. Each logging operation makes a single call to
the Writer's Write method. A Logger can be used simultaneously from
multiple goroutines; it guarantees to serialize access to the Writer.
-
Fatal
Receiver for *Logger v1.0([v])
Fatal is equivalent to l.Print() followed by a call to os.Exit(1).
-
Fatalf
Receiver for *Logger v1.0([format v])
Fatalf is equivalent to l.Printf() followed by a call to os.Exit(1).
-
Fatalln
Receiver for *Logger v1.0([v])
Fatalln is equivalent to l.Println() followed by a call to os.Exit(1).
-
Flags
Receiver for *Logger v1.0([])
Flags returns the output flags for the logger.
The flag bits are Ldate, Ltime, and so on.
-
Output
Receiver for *Logger v1.0([calldepth s])
Output writes the output for a logging event. The string s contains
the text to print after the prefix specified by the flags of the
Logger. A newline is appended if the last character of s is not
already a newline. Calldepth is used to recover the PC and is
provided for generality, although at the moment on all pre-defined
paths it will be 2.
-
Panic
Receiver for *Logger v1.0([v])
Panic is equivalent to l.Print() followed by a call to panic().
-
Panicf
Receiver for *Logger v1.0([format v])
Panicf is equivalent to l.Printf() followed by a call to panic().
-
Panicln
Receiver for *Logger v1.0([v])
Panicln is equivalent to l.Println() followed by a call to panic().
-
Prefix
Receiver for *Logger v1.0([])
Prefix returns the output prefix for the logger.
-
Print
Receiver for *Logger v1.0([v])
Print calls l.Output to print to the logger.
Arguments are handled in the manner of fmt.Print.
-
Printf
Receiver for *Logger v1.0([format v])
Printf calls l.Output to print to the logger.
Arguments are handled in the manner of fmt.Printf.
-
Println
Receiver for *Logger v1.0([v])
Println calls l.Output to print to the logger.
Arguments are handled in the manner of fmt.Println.
-
SetFlags
Receiver for *Logger v1.0([flag])
SetFlags sets the output flags for the logger.
The flag bits are Ldate, Ltime, and so on.
-
SetOutput
Receiver for *Logger v1.0([w])
SetOutput sets the output destination for the logger.
-
SetPrefix
Receiver for *Logger v1.0([prefix])
SetPrefix sets the output prefix for the logger.
-
Writer
Receiver for *Logger v1.0([])
Writer returns the output destination for the logger.
-
Logger
Concrete Type v1.0A Logger represents an active logging object that generates lines of
output to an io.Writer. Each logging operation makes a single call to
the Writer's Write method. A Logger can be used simultaneously from
multiple goroutines; it guarantees to serialize access to the Writer.
-
arrayOfLogger
Concrete Type v1.0A Logger represents an active logging object that generates lines of
output to an io.Writer. Each logging operation makes a single call to
the Writer's Write method. A Logger can be used simultaneously from
multiple goroutines; it guarantees to serialize access to the Writer.