Documentation ¶
Overview ¶
Package logging provides implementations of runtime.LoggingManager.
Index ¶
Constants ¶
const ( // Some logs are tiny, no need to reserve too much memory. InitialCapacity = 16384 // Cap each log at 1M. MaxCapacity = 1048576 // Safety gap to avoid buffer overruns. SafetyGap = 2048 )
These constants should some day move to config.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CircularBufferLoggingManager ¶
type CircularBufferLoggingManager struct {
// contains filtered or unexported fields
}
CircularBufferLoggingManager implements logging to circular fixed size buffer.
func NewCircularBufferLoggingManager ¶
func NewCircularBufferLoggingManager(fallbackLogger *log.Logger) *CircularBufferLoggingManager
NewCircularBufferLoggingManager initializes new CircularBufferLoggingManager.
func (*CircularBufferLoggingManager) ServiceLog ¶
func (manager *CircularBufferLoggingManager) ServiceLog(id string) runtime.LogHandler
ServiceLog implements runtime.LoggingManager interface.
func (*CircularBufferLoggingManager) SetSenders ¶
func (manager *CircularBufferLoggingManager) SetSenders(senders []runtime.LogSender) []runtime.LogSender
SetSenders implements runtime.LoggingManager interface.
type FileLoggingManager ¶
type FileLoggingManager struct {
// contains filtered or unexported fields
}
FileLoggingManager implements simple logging to files.
func NewFileLoggingManager ¶
func NewFileLoggingManager(logDirectory string) *FileLoggingManager
NewFileLoggingManager initializes new FileLoggingManager.
func (*FileLoggingManager) ServiceLog ¶
func (manager *FileLoggingManager) ServiceLog(id string) runtime.LogHandler
ServiceLog implements runtime.LoggingManager interface.
func (*FileLoggingManager) SetSenders ¶
func (manager *FileLoggingManager) SetSenders([]runtime.LogSender) []runtime.LogSender
SetSenders implements runtime.LoggingManager interface (by doing nothing).
type NullLoggingManager ¶
type NullLoggingManager struct{}
NullLoggingManager sends all the logs to /dev/null.
func NewNullLoggingManager ¶
func NewNullLoggingManager() *NullLoggingManager
NewNullLoggingManager initializes NullLoggingManager.
func (*NullLoggingManager) ServiceLog ¶
func (*NullLoggingManager) ServiceLog(id string) runtime.LogHandler
ServiceLog implements LoggingManager.
func (*NullLoggingManager) SetSenders ¶
func (*NullLoggingManager) SetSenders([]runtime.LogSender) []runtime.LogSender
SetSenders implements runtime.LoggingManager interface (by doing nothing).