import "github.com/ufoot/vapor/go/vplog"
Package vplog contains a simple log helper which logs on both stderr and syslog.
doc.go generate.go version.go vplog.go vplogger.go
const PackageCopyright = "Copyright (C) 2015, 2016 Christian Mauduit <ufoot@ufoot.org>" // PackageCopyright set by version.sh
PackageCopyright contains a short copyright notice.
const PackageEmail = "ufoot@ufoot.org" // PackageEmail set by version.sh
PackageEmail contains a contact email for the package.
const PackageLicense = "GNU GPL v3" // PackageLicense set by version.sh
PackageLicense contains a short license information.
const PackageName = "Vapor Toolkit" // PackageName set by version.sh
PackageName contains a readable name of the package, suitable for display.
const PackageTarname = "vapor" // PackageTarname set by version.sh
PackageTarname contains a short name of the package, suitable for a filename.
const PackageURL = "https://github.com/ufoot/vapor" // PackageURL set by version.sh
PackageURL contains the address of the project homepage.
const VersionMajor = 0 // VersionMajor set by version.sh
VersionMajor is the project major version.
const VersionMinor = 4 // VersionMinor set by version.sh
VersionMinor is the project minor version.
const VersionStamp = "c6a4298"
VersionStamp is the project stamp, possibly changes for each build.
func LogCrit(v ...interface{})
LogCrit logs a critical message, no formatting. Uses the default global logging backend.
LogCritf logs a critical message, formatting "à la" printf. Uses the default global logging backend.
func LogDebug(v ...interface{})
LogDebug logs a debug message, no formatting. Uses the default global logging backend.
LogDebugf logs a debug message, formatting "à la" printf. Uses the default global logging backend.
func LogErr(v ...interface{})
LogErr logs an error message, no formatting. Uses the default global logging backend.
LogErrf logs an error message, formatting "à la" printf. Uses the default global logging backend.
func LogFlush()
LogFlush flushes the global logging system, more precisely, flushes stderr.
func LogInfo(v ...interface{})
LogInfo logs an information message, no formatting. Uses the default global logging backend.
LogInfof logs an information message, formatting "à la" printf. Uses the default global logging backend.
LogInit initializes the log system. This is not mandatory, you might use functions such as LogWarning right away, the log file will be opened on-the-fly if needed. However, you might prefer to have the file opened at the very beginning of the program, without waiting for an artificial event. This is why this function is here. It can also be used to force a given file to be used, by default the program name "vapor" is used but it can be overridden.
func LogNotice(v ...interface{})
LogNotice logs a notice message, no formatting. Uses the default global logging backend.
LogNoticef logs a notice message, formatting "à la" printf. Uses the default global logging backend.
LogSetPriority sets the global, default logging level. Uses the default global logging backend.
func LogWarning(v ...interface{})
LogWarning logs a warning message, no formatting. Uses the default global logging backend.
LogWarningf logs a warning message, formatting "à la" printf. Uses the default global logging backend.
LoggerCrit logs a message with critical level. No formatting.
LoggerCritf logs a message with critical level. Formatting "à la" printf.
LoggerDebug logs a message with debug level. No formatting.
LoggerDebugf logs a message with debug level. Formatting "à la" printf.
LoggerErr logs a message with error level. No formatting.
LoggerErrf logs a message with error level. Formatting "à la" printf.
LoggerInfo logs a message with info level. No formatting.
LoggerInfof logs a message with info level. Formatting "à la" printf.
LoggerNotice logs a message with notice level. No formatting.
LoggerNoticef logs a message with notice level. Formatting "à la" printf.
LoggerWarning logs a message with warning level. No formatting.
LoggerWarningf logs a message with warning level. Formatting "à la" printf.
PriorityString returns a readable string (English word) that corresponds to a given log priority.
type Log struct {
// contains filtered or unexported fields
}
Log is a default implementation of the Logger interface. It basically logs informations in two places, which are the console (stderr) and syslog.
NewLog Constructs a new log object, note that this is called under the hood by the global shared object constructor.
Flush flushes all channels for which it makes sense to be flushed. This is automatically called if priority is CRIT, ERR, WARNING or NOTICE.
GetPriority returns the priority under which message won't be displayed any more.
Logp logs a message on all relevant channels. EOL is added at the end, you do not need to provide it.
Logpf logs a message on all relevant channels, using a printf-like syntax. EOL is added at the end, you do not need to provide it.
SetPriority sets the priority above which message won't be displayed any more.
type Logger interface { Logp(p Priority, v ...interface{}) Logpf(p Priority, f string, v ...interface{}) SetPriority(p Priority) GetPriority() Priority Flush() }
Logger is a custom logging interface, while the package with only one implementation, the interface is technically generic, and could be implemented/used elsewhere. This is design for quick-to-write global usage, not for universality/versatility.
Priority is a logging priority (AKA level), the lower the number, the higher the priority.
const ( // PriorityCrit should be used for critical messages. // Inspired from /usr/include/sys/syslog.h. // We don't use EMERG and ALERT PriorityCrit Priority = iota + Priority(int(syslog.LOG_CRIT)) // PriorityErr should be used for error messages. PriorityErr // PriorityWarning should be used for warning messages. PriorityWarning // PriorityNotice should be used for notice messages. PriorityNotice // PriorityInfo should be used for information messages. PriorityInfo // PriorityDebug should be used for debugging messages. PriorityDebug )
LogGetPriority returns the global, default logging level. Uses the default global logging backend.
Package vplog imports 8 packages (graph) and is imported by 8 packages. Updated 2016-11-06. Refresh now. Tools for package owners.