Documentation ¶
Index ¶
- Constants
- Variables
- func ConfigLog(logpath string)
- func CopyStandardLogTo(name string)
- func Create(t time.Time) (f *os.File, filename string, err error)
- func Debug(args ...interface{})
- func DebugDepth(depth int, args ...interface{})
- func Debugf(format string, args ...interface{})
- func Debugln(args ...interface{})
- func Error(args ...interface{})
- func ErrorDepth(depth int, args ...interface{})
- func Errorf(format string, args ...interface{})
- func Errorln(args ...interface{})
- func Exit(args ...interface{})
- func ExitDepth(depth int, args ...interface{})
- func Exitf(format string, args ...interface{})
- func Exitln(args ...interface{})
- func Fatal(args ...interface{})
- func FatalDepth(depth int, args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Fatalln(args ...interface{})
- func Flush()
- func GetTransActionID() string
- func Info(args ...interface{})
- func InfoDepth(depth int, args ...interface{})
- func Infof(format string, args ...interface{})
- func Infoln(args ...interface{})
- func SetLogLevel(l Level)
- func SetVersionType(t int)
- func Trace(args ...interface{})
- func TraceDepth(depth int, args ...interface{})
- func Tracef(format string, args ...interface{})
- func Traceln(args ...interface{})
- func Warning(args ...interface{})
- func WarningDepth(depth int, args ...interface{})
- func Warningf(format string, args ...interface{})
- func Warningln(args ...interface{})
- type Level
- type OutputStats
Constants ¶
const ( VerDev = iota VerRelease )
const PluginProgramName = "knitter"
Variables ¶
var MaxSize uint64 = 1024 * 1024 * 1800
MaxSize is the maximum size of a log file in bytes.
var Stats struct { Trace, Debug, Info, Warning, Error OutputStats }
Stats tracks the number of lines of output and number of bytes per severity level. Values must be read with atomic.LoadInt64.
Functions ¶
func CopyStandardLogTo ¶
func CopyStandardLogTo(name string)
CopyStandardLogTo arranges for messages written to the Go "log" package's default logs to also appear in the Google logs for the named and lower severities. Subsequent changes to the standard log's default output location or format may break this behavior.
Valid names are "INFO", "WARNING", "ERROR", and "FATAL". If the name is not recognized, CopyStandardLogTo panics.
func Create ¶
create creates a new log file and returns the file and its filename, which contains tag ("INFO", "FATAL", etc.) and t. If the file is created successfully, create also attempts to update the symlink for that tag, ignoring errors.
func Debug ¶
func Debug(args ...interface{})
Debug logs to the Debug log. Arguments are handled in the manner of fmt.Print; a newline is appended if missing.
func DebugDepth ¶
func DebugDepth(depth int, args ...interface{})
DebugDepth acts as Debug but uses depth to determine which call frame to log. DebugDepth(0, "msg") is the same as Debug("msg").
func Debugf ¶
func Debugf(format string, args ...interface{})
Debugf logs to the Debug log. Arguments are handled in the manner of fmt.Printf; a newline is appended if missing.
func Debugln ¶
func Debugln(args ...interface{})
Debugln logs to the Debug log. Arguments are handled in the manner of fmt.Println; a newline is appended if missing.
func Error ¶
func Error(args ...interface{})
Error logs to the ERROR, WARNING, and INFO logs. Arguments are handled in the manner of fmt.Print; a newline is appended if missing.
func ErrorDepth ¶
func ErrorDepth(depth int, args ...interface{})
ErrorDepth acts as Error but uses depth to determine which call frame to log. ErrorDepth(0, "msg") is the same as Error("msg").
func Errorf ¶
func Errorf(format string, args ...interface{})
Errorf logs to the ERROR, WARNING, and INFO logs. Arguments are handled in the manner of fmt.Printf; a newline is appended if missing.
func Errorln ¶
func Errorln(args ...interface{})
Errorln logs to the ERROR, WARNING, and INFO logs. Arguments are handled in the manner of fmt.Println; a newline is appended if missing.
func Exit ¶
func Exit(args ...interface{})
Exit logs to the FATAL, ERROR, WARNING, and INFO logs, then calls os.Exit(1). Arguments are handled in the manner of fmt.Print; a newline is appended if missing.
func ExitDepth ¶
func ExitDepth(depth int, args ...interface{})
ExitDepth acts as Exit but uses depth to determine which call frame to log. ExitDepth(0, "msg") is the same as Exit("msg").
func Exitf ¶
func Exitf(format string, args ...interface{})
Exitf logs to the FATAL, ERROR, WARNING, and INFO logs, then calls os.Exit(1). Arguments are handled in the manner of fmt.Printf; a newline is appended if missing.
func Exitln ¶
func Exitln(args ...interface{})
Exitln logs to the FATAL, ERROR, WARNING, and INFO logs, then calls os.Exit(1).
func Fatal ¶
func Fatal(args ...interface{})
Fatal logs to the FATAL, ERROR, WARNING, and INFO logs, including a stack trace of all running goroutines, then calls os.Exit(255). Arguments are handled in the manner of fmt.Print; a newline is appended if missing.
func FatalDepth ¶
func FatalDepth(depth int, args ...interface{})
FatalDepth acts as Fatal but uses depth to determine which call frame to log. FatalDepth(0, "msg") is the same as Fatal("msg").
func Fatalf ¶
func Fatalf(format string, args ...interface{})
Fatalf logs to the FATAL, ERROR, WARNING, and INFO logs, including a stack trace of all running goroutines, then calls os.Exit(255). Arguments are handled in the manner of fmt.Printf; a newline is appended if missing.
func Fatalln ¶
func Fatalln(args ...interface{})
Fatalln logs to the FATAL, ERROR, WARNING, and INFO logs, including a stack trace of all running goroutines, then calls os.Exit(255). Arguments are handled in the manner of fmt.Println; a newline is appended if missing.
func GetTransActionID ¶
func GetTransActionID() string
func Info ¶
func Info(args ...interface{})
Info logs to the INFO log. Arguments are handled in the manner of fmt.Print; a newline is appended if missing.
func InfoDepth ¶
func InfoDepth(depth int, args ...interface{})
InfoDepth acts as Info but uses depth to determine which call frame to log. InfoDepth(0, "msg") is the same as Info("msg").
func Infof ¶
func Infof(format string, args ...interface{})
Infof logs to the INFO log. Arguments are handled in the manner of fmt.Printf; a newline is appended if missing.
func Infoln ¶
func Infoln(args ...interface{})
Infoln logs to the INFO log. Arguments are handled in the manner of fmt.Println; a newline is appended if missing.
func SetVersionType ¶
func SetVersionType(t int)
func Trace ¶
func Trace(args ...interface{})
Trace logs to the Trace log. Arguments are handled in the manner of fmt.Print; a newline is appended if missing.
func TraceDepth ¶
func TraceDepth(depth int, args ...interface{})
TraceDepth acts as Trace but uses depth to determine which call frame to log. TraceDepth(0, "msg") is the same as Trace("msg").
func Tracef ¶
func Tracef(format string, args ...interface{})
Tracef logs to the Trace log. Arguments are handled in the manner of fmt.Printf; a newline is appended if missing.
func Traceln ¶
func Traceln(args ...interface{})
Traceln logs to the Trace log. Arguments are handled in the manner of fmt.Println; a newline is appended if missing.
func Warning ¶
func Warning(args ...interface{})
Warning logs to the WARNING and INFO logs. Arguments are handled in the manner of fmt.Print; a newline is appended if missing.
func WarningDepth ¶
func WarningDepth(depth int, args ...interface{})
WarningDepth acts as Warning but uses depth to determine which call frame to log. WarningDepth(0, "msg") is the same as Warning("msg").
Types ¶
type Level ¶
type Level int32
Level specifies a level of level for V logs. *Level implements flag.Value; the -v flag is of type Level and should be modified only through the flag.Value interface.
type OutputStats ¶
type OutputStats struct {
// contains filtered or unexported fields
}
OutputStats tracks the number of output lines and bytes written.
func (*OutputStats) Bytes ¶
func (s *OutputStats) Bytes() int64
Bytes returns the number of bytes written.
func (*OutputStats) Lines ¶
func (s *OutputStats) Lines() int64
Lines returns the number of lines written.