Documentation
¶
Index ¶
- func Print(t MessageType, level LogLevel, content ...interface{})
- func PrintConnect(level LogLevel, content ...interface{})
- func PrintDisconnect(level LogLevel, content ...interface{})
- func PrintDone(level LogLevel, content ...interface{})
- func PrintError(level LogLevel, content ...interface{})
- func PrintFatal(level LogLevel, content ...interface{})
- func PrintInfo(level LogLevel, content ...interface{})
- func PrintMount(level LogLevel, content ...interface{})
- func PrintProgress(level LogLevel, content ...interface{})
- func PrintRequest(level LogLevel, content ...interface{})
- func PrintResolve(level LogLevel, content ...interface{})
- func PrintUnmount(level LogLevel, content ...interface{})
- func PrintWarning(level LogLevel, content ...interface{})
- func SetLogDirectory(directoryName string)
- func SetLogLevel(level LogLevel)
- func Stop()
- func UnsetLogDirectory()
- type LogLevel
- type Message
- type MessageType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Print ¶
func Print(t MessageType, level LogLevel, content ...interface{})
Print queues a single message to be logged/
func PrintConnect ¶
func PrintConnect(level LogLevel, content ...interface{})
PrintConnect logs a message of type connect. This should be used to log a * client connecting.
func PrintDisconnect ¶
func PrintDisconnect(level LogLevel, content ...interface{})
PrintDisconnect logs a message of type disconnect. This should be used to log * a client disconnecting.
func PrintDone ¶
func PrintDone(level LogLevel, content ...interface{})
PrintDone logs a message of type done. This should be used to log the * successful completion of a task.
func PrintError ¶
func PrintError(level LogLevel, content ...interface{})
PrintError logs a message of type error. This should be used when an * operation encounters a problem. This typically causes the operation to halt. * This should not log an event that causes a goroutine or the entire program * to stop.
func PrintFatal ¶
func PrintFatal(level LogLevel, content ...interface{})
PrintFatal logs a message of type fatal. This should be used to log errors * that caused a goroutine, internal communication channel, or the entire * program to terminate.
func PrintInfo ¶
func PrintInfo(level LogLevel, content ...interface{})
PrintDone logs a message of type info. This should be used to log * informational messages and general observations the program makes that could * be useful to whoever is reading the log.
func PrintMount ¶
func PrintMount(level LogLevel, content ...interface{})
PrintMount logs a message of type mount. This should be used to log a client * mounting successfully.
func PrintProgress ¶
func PrintProgress(level LogLevel, content ...interface{})
PrintProgress logs a message of type progress. This should be used to log * steps of an overall task.
func PrintRequest ¶
func PrintRequest(level LogLevel, content ...interface{})
PrintRequest logs a message of type request. This should be used to log an * external request made by a client.
func PrintResolve ¶
func PrintResolve(level LogLevel, content ...interface{})
PrintResolve logs a message of type resolve. This should be used when a * request made by a client was resolved successfully.
func PrintUnmount ¶
func PrintUnmount(level LogLevel, content ...interface{})
PrintUnmount logs a message of type unmount This should be used to log a * client unmounting successfully.
func PrintWarning ¶
func PrintWarning(level LogLevel, content ...interface{})
PrintWarning logs a message of type warning. This should be used to log a * problem which did not cause an error. Useful for logging suspicious behavior * or insecure configuration parameters.
func SetLogDirectory ¶
func SetLogDirectory(directoryName string)
SetLogDirectory sets the directory logs are to be written to. In this * directory, log files will be created with a name formatted like this: * * YYYY-MM-DD.log * * When a message is logged, and a day has passed since the last message, a new * file is created.
func SetLogLevel ¶
func SetLogLevel(level LogLevel)
SetLogLevel sets the log level. Only messages with the specified log level * or higher will be logged.
func Stop ¶ added in v0.2.0
func Stop()
Stop causes scribe to log all remaning things, and then completely stop. this * function waits until that has happened.
func UnsetLogDirectory ¶
func UnsetLogDirectory()
UnsetLogDirectory causes the logging system to stop writing to files, and * sets all output to stdout.
Types ¶
type LogLevel ¶
type LogLevel int
LogLevel specifies what messages are to be logged, and what messages are to * be ignored.
const ( // Print any and all info for debugging purposes. LogLevelDebug LogLevel = 0 // Only print some info, such as logging requests and connections, and // errors LogLevelNormal LogLevel = 1 // Only print errors LogLevelError LogLevel = 2 // Completely disable logging. You DO NOT want to do this! LogLevelNone LogLevel = 3 )
All log levels.
type Message ¶
type Message struct {
// The type of the message
Type MessageType
// The importance of a message
Level LogLevel
// The message content (what gets printed)
Content []interface{}
}
Message structs are sent down Scribe's message channel. They contain * information about the message to be logged.
type MessageType ¶
type MessageType int
Different types of message. These determine what kind of symbol is displayed * on a message.
const ( // ... Progress MessageType = iota // .// Done // (i) Info // !!! Warning // ERR Error // XXX Fatal // ->? Request // ->! Resolve // --> Connect // -=E Mount // <-- Disconnect // X=- Unmount // =#= Bind // =X= Unbind )
All message types.