Documentation ¶
Index ¶
- Constants
- func Begin(format string, d ...interface{}) *activity
- func DisableOutput(output string)
- func EnableFileLogger(dir string) (io.Closer, error)
- func EnableOutput(output string)
- func EnableStdErrLogger()
- func EnableStdOutPresenter()
- func Error(err error) error
- func ErrorStr(format string, d ...interface{}) string
- func HandleFunc(handler Handler, output string)
- func Increment(tpw TotalProgressWriter)
- func Log(format string, d ...interface{})
- func QueueBegin(format string, d ...interface{}) *queue
- func RequestLog(h http.Handler) http.Handler
- func TotalInt(tpw TotalProgressWriter, total int)
- type ActCloser
- type Handler
- type MessageType
- type Queue
- type TotalProgressWriter
Constants ¶
View Source
const ( StdOut = "stdout" StdErr = "stderr" FileLog = "file_log" )
View Source
const (
TimeFormat = "2006-01-02-15-04-05"
)
Variables ¶
This section is empty.
Functions ¶
func DisableOutput ¶ added in v0.1.7
func DisableOutput(output string)
func EnableOutput ¶ added in v0.1.7
func EnableOutput(output string)
func EnableStdErrLogger ¶ added in v0.1.5
func EnableStdErrLogger()
func EnableStdOutPresenter ¶ added in v0.1.5
func EnableStdOutPresenter()
func HandleFunc ¶
func Increment ¶ added in v0.1.20
func Increment(tpw TotalProgressWriter)
func QueueBegin ¶ added in v0.1.5
func QueueBegin(format string, d ...interface{}) *queue
func RequestLog ¶ added in v0.1.12
RequestLog is a trivial logging middleware that logs the URL of the request
func TotalInt ¶ added in v0.1.20
func TotalInt(tpw TotalProgressWriter, total int)
Types ¶
type Handler ¶ added in v0.1.4
type Handler interface { Handle(msgType MessageType, payload interface{}, topic string) Close() error }
type MessageType ¶
type MessageType int
const ( //MsgNone is a message type initial value. No payload MsgNone MessageType = iota //MsgBegin signals start of an activity. No payload MsgBegin //MsgError provides not-fatal error that happened during activity execution. Payload: error MsgError //MsgTotal sets expected total value of an activity progress. Payload: uint64 MsgTotal //MsgCurrent updates current value of an activity progress. Payload: uint64 MsgCurrent //MsgLog sends a value useful for logging. Payload: string MsgLog //MsgResult provides result of an activity. Payload type: string MsgResult //MsgSummary provides map of categorized results. Payload: headingSections MsgSummary //MsgEnd signals completion of an activity. No payload MsgEnd )
func (MessageType) String ¶ added in v0.1.5
func (mt MessageType) String() string
type TotalProgressWriter ¶ added in v0.1.4
type TotalProgressWriter interface { Total(uint64) Current(uint64) Progress(uint64) TotalInt(int) CurrentInt(int) ProgressInt(int) Increment() io.Writer ActCloser }
func NewProgress ¶ added in v0.1.5
func NewProgress(format string, d ...interface{}) TotalProgressWriter
Click to show internal directories.
Click to hide internal directories.