Documentation ¶
Index ¶
- Constants
- Variables
- func Paint(s string, foreground Color, foregroundHi bool, background Color, ...) string
- type Backend
- type Color
- type Level
- type Logger
- func (l *Logger) Debug(message ...interface{})
- func (l *Logger) Debugf(format string, val ...interface{})
- func (l *Logger) Error(message ...interface{})
- func (l *Logger) Errorf(format string, val ...interface{})
- func (l *Logger) Info(message ...interface{})
- func (l *Logger) Infof(format string, val ...interface{})
- func (l *Logger) Init(message ...interface{})
- func (l *Logger) Initf(format string, val ...interface{})
- func (l *Logger) PrintSuccess()
- func (l *Logger) SetBackend(backend Backend) *Logger
- func (l *Logger) SetDebug(debug bool) *Logger
- func (l *Logger) SetTemplate(tmpl string) *Logger
- func (l *Logger) Success(message ...interface{})
- func (l *Logger) Successf(format string, val ...interface{})
- type Message
- type MessageCollector
- type MessageCompleter
- type MessageCompletionHandler
- type MessageFilter
- type MessageFuture
- type MessageObservable
- func (o *MessageObservable) AsChan() (c chan Message, cancel *eventual2go.Completer)
- func (o *MessageObservable) Change(value Message)
- func (o *MessageObservable) NextChange() (f *MessageFuture)
- func (o *MessageObservable) OnChange(s MessageSubscriber) (cancel *eventual2go.Completer)
- func (o *MessageObservable) Stream() *MessageStream
- func (o *MessageObservable) Value() Message
- type MessageStream
- func (s *MessageStream) AsChan() (c chan Message, stop *eventual2go.Completer)
- func (s *MessageStream) First() *MessageFuture
- func (s *MessageStream) FirstWhere(f ...MessageFilter) *MessageFuture
- func (s *MessageStream) FirstWhereNot(f ...MessageFilter) *MessageFuture
- func (s *MessageStream) Listen(ss MessageSubscriber) *eventual2go.Completer
- func (s *MessageStream) ListenNonBlocking(ss MessageSubscriber) *eventual2go.Completer
- func (s *MessageStream) Split(f MessageFilter) (*MessageStream, *MessageStream)
- func (s *MessageStream) TransformWhere(t eventual2go.Transformer, f ...MessageFilter) *eventual2go.Stream
- func (s *MessageStream) Where(f ...MessageFilter) *MessageStream
- func (s *MessageStream) WhereNot(f ...MessageFilter) *MessageStream
- type MessageStreamController
- type MessageSubscriber
- type WriterBackend
Constants ¶
View Source
const ( INFO string = "INFO" INIT = "INIT" ERROR = "ERROR" FATAL = "FATAL" DEBUG = "DEBUG" SUCCESS = "SUCCESS" WARNING = "WARNING" )
Variables ¶
View Source
var DefaultLevels = map[string]Level{ INFO: Level{Name: INFO, Foreground: GREEN}, INIT: Level{Name: INIT, Foreground: BLUE, ForegroundHi: true}, WARNING: Level{Name: WARNING, Background: YELLOW, BackgroundHi: true}, ERROR: Level{Name: ERROR, Foreground: WHITE, Background: RED}, FATAL: Level{Name: FATAL, Foreground: WHITE, Background: RED, BackgroundHi: true}, SUCCESS: Level{Name: SUCCESS, Foreground: CYAN}, DEBUG: Level{Name: DEBUG, Background: YELLOW, BackgroundHi: true}, }
Functions ¶
Types ¶
type Color ¶
type Color int
func (Color) AsBackground ¶
func (Color) AsForeground ¶
func (Color) AsHiBackground ¶
func (Color) AsHiForeground ¶
type Logger ¶
type Logger struct { Prefix string // contains filtered or unexported fields }
func (*Logger) PrintSuccess ¶
func (l *Logger) PrintSuccess()
func (*Logger) SetBackend ¶
func (*Logger) SetTemplate ¶
type Message ¶
type Message struct { Timestamp time.Time Prefix string Level Level Msg string Nr uint64 // contains filtered or unexported fields }
func NewMessage ¶
func (Message) FormattedTime ¶
type MessageCollector ¶
type MessageCollector struct {
*eventual2go.Collector
}
func NewMessageCollector ¶
func NewMessageCollector() *MessageCollector
func (*MessageCollector) Add ¶
func (c *MessageCollector) Add(d Message)
func (*MessageCollector) AddFuture ¶
func (c *MessageCollector) AddFuture(f *MessageFuture)
func (*MessageCollector) AddStream ¶
func (c *MessageCollector) AddStream(s *MessageStream)
func (*MessageCollector) Get ¶
func (c *MessageCollector) Get() Message
func (*MessageCollector) Preview ¶
func (c *MessageCollector) Preview() Message
type MessageCompleter ¶
type MessageCompleter struct {
*eventual2go.Completer
}
func NewMessageCompleter ¶
func NewMessageCompleter() *MessageCompleter
func (*MessageCompleter) Complete ¶
func (c *MessageCompleter) Complete(d Message)
func (*MessageCompleter) Future ¶
func (c *MessageCompleter) Future() *MessageFuture
type MessageFilter ¶
type MessageFuture ¶
type MessageFuture struct {
*eventual2go.Future
}
func (*MessageFuture) AsChan ¶
func (f *MessageFuture) AsChan() chan Message
func (*MessageFuture) Result ¶
func (f *MessageFuture) Result() Message
func (*MessageFuture) Then ¶
func (f *MessageFuture) Then(ch MessageCompletionHandler) *MessageFuture
type MessageObservable ¶
type MessageObservable struct {
*eventual2go.Observable
}
func NewMessageObservable ¶
func NewMessageObservable(value Message) (o *MessageObservable)
func (*MessageObservable) AsChan ¶
func (o *MessageObservable) AsChan() (c chan Message, cancel *eventual2go.Completer)
func (*MessageObservable) Change ¶
func (o *MessageObservable) Change(value Message)
func (*MessageObservable) NextChange ¶
func (o *MessageObservable) NextChange() (f *MessageFuture)
func (*MessageObservable) OnChange ¶
func (o *MessageObservable) OnChange(s MessageSubscriber) (cancel *eventual2go.Completer)
func (*MessageObservable) Stream ¶
func (o *MessageObservable) Stream() *MessageStream
func (*MessageObservable) Value ¶
func (o *MessageObservable) Value() Message
type MessageStream ¶
type MessageStream struct {
*eventual2go.Stream
}
func (*MessageStream) AsChan ¶
func (s *MessageStream) AsChan() (c chan Message, stop *eventual2go.Completer)
func (*MessageStream) First ¶
func (s *MessageStream) First() *MessageFuture
func (*MessageStream) FirstWhere ¶
func (s *MessageStream) FirstWhere(f ...MessageFilter) *MessageFuture
func (*MessageStream) FirstWhereNot ¶
func (s *MessageStream) FirstWhereNot(f ...MessageFilter) *MessageFuture
func (*MessageStream) Listen ¶
func (s *MessageStream) Listen(ss MessageSubscriber) *eventual2go.Completer
func (*MessageStream) ListenNonBlocking ¶
func (s *MessageStream) ListenNonBlocking(ss MessageSubscriber) *eventual2go.Completer
func (*MessageStream) Split ¶
func (s *MessageStream) Split(f MessageFilter) (*MessageStream, *MessageStream)
func (*MessageStream) TransformWhere ¶
func (s *MessageStream) TransformWhere(t eventual2go.Transformer, f ...MessageFilter) *eventual2go.Stream
func (*MessageStream) Where ¶
func (s *MessageStream) Where(f ...MessageFilter) *MessageStream
func (*MessageStream) WhereNot ¶
func (s *MessageStream) WhereNot(f ...MessageFilter) *MessageStream
type MessageStreamController ¶
type MessageStreamController struct {
*eventual2go.StreamController
}
func NewMessageStreamController ¶
func NewMessageStreamController() *MessageStreamController
func (*MessageStreamController) Add ¶
func (sc *MessageStreamController) Add(d Message)
func (*MessageStreamController) Join ¶
func (sc *MessageStreamController) Join(s *MessageStream)
func (*MessageStreamController) JoinFuture ¶
func (sc *MessageStreamController) JoinFuture(f *MessageFuture)
func (*MessageStreamController) Stream ¶
func (sc *MessageStreamController) Stream() *MessageStream
type MessageSubscriber ¶
type MessageSubscriber func(Message)
type WriterBackend ¶
type WriterBackend struct {
// contains filtered or unexported fields
}
func NewWriterBackend ¶
func NewWriterBackend(writer io.Writer) (b *WriterBackend)
func (*WriterBackend) Write ¶
func (b *WriterBackend) Write(msg Message)
Click to show internal directories.
Click to hide internal directories.