 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Overview ¶
* Copyright (C) 2020-2021 Arm Limited or its affiliates and Contributors. All rights reserved. * SPDX-License-Identifier: Apache-2.0
* Copyright (C) 2020-2021 Arm Limited or its affiliates and Contributors. All rights reserved. * SPDX-License-Identifier: Apache-2.0
* Copyright (C) 2020-2021 Arm Limited or its affiliates and Contributors. All rights reserved. * SPDX-License-Identifier: Apache-2.0
* Copyright (C) 2020-2021 Arm Limited or its affiliates and Contributors. All rights reserved. * SPDX-License-Identifier: Apache-2.0
* Copyright (C) 2020-2021 Arm Limited or its affiliates and Contributors. All rights reserved. * SPDX-License-Identifier: Apache-2.0
* Copyright (C) 2020-2021 Arm Limited or its affiliates and Contributors. All rights reserved. * SPDX-License-Identifier: Apache-2.0
* Copyright (C) 2020-2021 Arm Limited or its affiliates and Contributors. All rights reserved. * SPDX-License-Identifier: Apache-2.0
* Copyright (C) 2020-2021 Arm Limited or its affiliates and Contributors. All rights reserved. * SPDX-License-Identifier: Apache-2.0
* Copyright (C) 2020-2021 Arm Limited or its affiliates and Contributors. All rights reserved. * SPDX-License-Identifier: Apache-2.0
Index ¶
- type AsynchronousLoggers
- func (l *AsynchronousLoggers) Check() error
- func (l *AsynchronousLoggers) Close() error
- func (l *AsynchronousLoggers) GetLoggerSource() string
- func (l *AsynchronousLoggers) Log(output ...interface{})
- func (l *AsynchronousLoggers) LogError(err ...interface{})
- func (l *AsynchronousLoggers) SetLogSource(source string) error
- func (l *AsynchronousLoggers) SetLoggerSource(source string) error
 
- type DiodeWriter
- type FileLoggers
- type GenericLoggers
- func (l *GenericLoggers) Check() error
- func (l *GenericLoggers) Close() error
- func (l *GenericLoggers) Log(output ...interface{})
- func (l *GenericLoggers) LogError(err ...interface{})
- func (l *GenericLoggers) SetLogSource(source string) error
- func (l *GenericLoggers) SetLoggerSource(source string) error
 
- type JSONLoggers
- func (l *JSONLoggers) Check() error
- func (l *JSONLoggers) Close() error
- func (l *JSONLoggers) Configure() error
- func (l *JSONLoggers) GetLoggerSource() string
- func (l *JSONLoggers) GetSource() string
- func (l *JSONLoggers) Log(output ...interface{})
- func (l *JSONLoggers) LogError(err ...interface{})
- func (l *JSONLoggers) SetLogSource(source string) error
- func (l *JSONLoggers) SetLoggerSource(source string) error
 
- type Loggers
- func CreateFileLogger(logFile string, loggerSource string) (loggers Loggers, err error)
- func CreateStdLogger(loggerSource string) (loggers Loggers, err error)
- func NewAsynchronousLoggers(slowOutputWriter WriterWithSource, slowErrorWriter WriterWithSource, ...) (loggers Loggers, err error)
- func NewAsynchronousStdLogger(loggerSource string, ringBufferSize int, pollInterval time.Duration, ...) (loggers Loggers, err error)
- func NewJSONLogger(writer WriterWithSource, loggerSource string, source string) (loggers Loggers, err error)
- func NewJSONLoggerForSlowWriter(slowWriter WriterWithSource, ringBufferSize int, pollInterval time.Duration, ...) (loggers Loggers, err error)
- func NewLogrusLogger(logrusL *logrus.Logger, loggerSource string) (loggers Loggers, err error)
- func NewNoopLogger(loggerSource string) (loggers Loggers, err error)
 
- type MultipleWritersWithSource
- func (w *MultipleWritersWithSource) AddWriters(writers ...WriterWithSource) error
- func (w *MultipleWritersWithSource) Close() (err error)
- func (w *MultipleWritersWithSource) GetWriters() ([]WriterWithSource, error)
- func (w *MultipleWritersWithSource) SetSource(source string) (err error)
- func (w *MultipleWritersWithSource) Write(p []byte) (n int, err error)
 
- type StdErrWriter
- type StdWriter
- type StringLoggers
- type StringWriter
- type WriterWithSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsynchronousLoggers ¶
type AsynchronousLoggers struct {
	// contains filtered or unexported fields
}
    func (*AsynchronousLoggers) Check ¶
func (l *AsynchronousLoggers) Check() error
func (*AsynchronousLoggers) Close ¶
func (l *AsynchronousLoggers) Close() error
func (*AsynchronousLoggers) GetLoggerSource ¶
func (l *AsynchronousLoggers) GetLoggerSource() string
func (*AsynchronousLoggers) Log ¶
func (l *AsynchronousLoggers) Log(output ...interface{})
func (*AsynchronousLoggers) LogError ¶
func (l *AsynchronousLoggers) LogError(err ...interface{})
func (*AsynchronousLoggers) SetLogSource ¶
func (l *AsynchronousLoggers) SetLogSource(source string) error
func (*AsynchronousLoggers) SetLoggerSource ¶
func (l *AsynchronousLoggers) SetLoggerSource(source string) error
type DiodeWriter ¶
type DiodeWriter struct {
	WriterWithSource
	// contains filtered or unexported fields
}
    func (*DiodeWriter) Close ¶
func (w *DiodeWriter) Close() error
func (*DiodeWriter) SetSource ¶
func (w *DiodeWriter) SetSource(source string) error
type FileLoggers ¶
type FileLoggers struct {
	GenericLoggers
	File *os.File
}
    func (*FileLoggers) Check ¶
func (l *FileLoggers) Check() (err error)
type GenericLoggers ¶
Definition of command loggers
func (*GenericLoggers) Check ¶
func (l *GenericLoggers) Check() error
Checks whether the loggers are correctly defined or not.
func (*GenericLoggers) Log ¶
func (l *GenericLoggers) Log(output ...interface{})
Logs to the output logger.
func (*GenericLoggers) LogError ¶
func (l *GenericLoggers) LogError(err ...interface{})
Logs to the Error logger.
func (*GenericLoggers) SetLogSource ¶
func (l *GenericLoggers) SetLogSource(source string) error
func (*GenericLoggers) SetLoggerSource ¶
func (l *GenericLoggers) SetLoggerSource(source string) error
type JSONLoggers ¶
type JSONLoggers struct {
	Loggers
	Zerologger zerolog.Logger
	// contains filtered or unexported fields
}
    Definition of JSON message loggers
func (*JSONLoggers) Check ¶
func (l *JSONLoggers) Check() error
Checks whether the loggers are correctly defined or not.
func (*JSONLoggers) Configure ¶
func (l *JSONLoggers) Configure() error
func (*JSONLoggers) GetLoggerSource ¶
func (l *JSONLoggers) GetLoggerSource() string
func (*JSONLoggers) GetSource ¶
func (l *JSONLoggers) GetSource() string
func (*JSONLoggers) Log ¶
func (l *JSONLoggers) Log(output ...interface{})
Logs to the output logger.
func (*JSONLoggers) LogError ¶
func (l *JSONLoggers) LogError(err ...interface{})
Logs to the Error logger.
func (*JSONLoggers) SetLogSource ¶
func (l *JSONLoggers) SetLogSource(source string) error
func (*JSONLoggers) SetLoggerSource ¶
func (l *JSONLoggers) SetLoggerSource(source string) error
type Loggers ¶
type Loggers interface {
	io.Closer
	// Checks whether the loggers are correctly defined or not.
	Check() error
	// Sets the source of the log message e.g. related build job, related command, etc.
	SetLogSource(source string) error
	// Sets the source of the logger e.g. APIs, Build worker, CMSIS tools.
	SetLoggerSource(source string) error
	// Logs to the output logger.
	Log(output ...interface{})
	// Logs to the Error logger.
	LogError(err ...interface{})
}
    func CreateFileLogger ¶
Creates a logger to a file
func CreateStdLogger ¶
Creates a logger to standard output/error
func NewAsynchronousLoggers ¶
func NewAsynchronousLoggers(slowOutputWriter WriterWithSource, slowErrorWriter WriterWithSource, ringBufferSize int, pollInterval time.Duration, loggerSource string, source string, droppedMessagesLogger Loggers) (loggers Loggers, err error)
func NewJSONLogger ¶
func NewJSONLogger(writer WriterWithSource, loggerSource string, source string) (loggers Loggers, err error)
func NewJSONLoggerForSlowWriter ¶
func NewJSONLoggerForSlowWriter(slowWriter WriterWithSource, ringBufferSize int, pollInterval time.Duration, loggerSource string, source string, droppedMessagesLogger Loggers) (loggers Loggers, err error)
NewJSONLoggerForSlowWriter creates a lock free, non blocking & thread safe logger wrapped around slowWriter
params:
slowWriter : writer used to write data streams ringBufferSize : size of ring buffer used to receive messages pollInterval : polling duration to check buffer content loggerSource : logger application name source : source string droppedMessagesLogger : logger for dropped messages
If pollInterval is greater than 0, a poller is used otherwise a waiter is used.
func NewLogrusLogger ¶
Creates a logger to logrus logger (https://github.com/Sirupsen/logrus)
func NewNoopLogger ¶
type MultipleWritersWithSource ¶
type MultipleWritersWithSource struct {
	// contains filtered or unexported fields
}
    func CreateMultipleWritersWithSource ¶
func CreateMultipleWritersWithSource(writers ...WriterWithSource) (writer *MultipleWritersWithSource, err error)
func (*MultipleWritersWithSource) AddWriters ¶
func (w *MultipleWritersWithSource) AddWriters(writers ...WriterWithSource) error
func (*MultipleWritersWithSource) Close ¶
func (w *MultipleWritersWithSource) Close() (err error)
func (*MultipleWritersWithSource) GetWriters ¶
func (w *MultipleWritersWithSource) GetWriters() ([]WriterWithSource, error)
func (*MultipleWritersWithSource) SetSource ¶
func (w *MultipleWritersWithSource) SetSource(source string) (err error)
type StdErrWriter ¶
type StdErrWriter struct {
	WriterWithSource
}
    func (*StdErrWriter) Close ¶
func (w *StdErrWriter) Close() error
func (*StdErrWriter) SetSource ¶
func (w *StdErrWriter) SetSource(source string) error
type StdWriter ¶
type StdWriter struct {
	WriterWithSource
}
    type StringLoggers ¶
type StringLoggers struct {
	GenericLoggers
	LogWriter StringWriter
}
    func CreateStringLogger ¶
func CreateStringLogger(loggerSource string) (loggers *StringLoggers, err error)
Creates a logger to standard output/error
func (*StringLoggers) Check ¶
func (l *StringLoggers) Check() error
func (*StringLoggers) GetLogContent ¶
func (l *StringLoggers) GetLogContent() string
type StringWriter ¶
type StringWriter struct {
	io.WriteCloser
	Logs strings.Builder
	// contains filtered or unexported fields
}
    func (*StringWriter) Close ¶
func (w *StringWriter) Close() (err error)
func (*StringWriter) GetFullContent ¶
func (w *StringWriter) GetFullContent() string
type WriterWithSource ¶
type WriterWithSource interface {
	io.WriteCloser
	SetSource(source string) error
}
    func NewDiodeWriterForSlowWriter ¶
func NewDiodeWriterForSlowWriter(slowWriter WriterWithSource, ringBufferSize int, pollInterval time.Duration, droppedMessagesLogger Loggers) WriterWithSource