Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CloudWatchLogEventSlice ¶
type CloudWatchLogEventSlice struct {
// contains filtered or unexported fields
}
CloudWatchLogEventSlice stores a thread safe slice of InputLogEvents. size is the current size in bytes of the log messages taking into account the inputLogEventOffet.
type CloudWatchLogger ¶
type CloudWatchLogger struct {
// contains filtered or unexported fields
}
CloudWatchLogger is a structured logger that logs to CloudWatch and is thread safe.
func NewCloudWatchLogger ¶
func NewCloudWatchLogger(ctx context.Context, profile string, region string, logGroupName string, globalFields Fields) (*CloudWatchLogger, error)
NewCloudWatchLogger initializes a new CloudWatchLogger object and returns it. The profile and region parameters are optional if authentication with CloudWatch can be provided in other ways, such as IAM roles. logGroupName is the name of the log group in CloudWatch. globalFields are the fields that are written in every log message.
func (*CloudWatchLogger) Debug ¶
func (c *CloudWatchLogger) Debug(fields Fields) error
Debug writes a log message at a debug level.
func (*CloudWatchLogger) Error ¶
func (c *CloudWatchLogger) Error(fields Fields) error
Error writes a log message at an error level.
func (*CloudWatchLogger) Info ¶
func (c *CloudWatchLogger) Info(fields Fields) error
Info writes a log message at an info level.
type Logger ¶
type Logger interface { Info(fields Fields) error Error(fields Fields) error Debug(fields Fields) error }
Logger is a structured logger interface.
var Log Logger
Log is the package wide Logger. This can be used to have a Logger that is globally available within a codebase.
type StandardLogger ¶
type StandardLogger struct {
// contains filtered or unexported fields
}
StandardLogger is a structured logger that is thread safe.
func NewStandardLogger ¶
func NewStandardLogger(output io.Writer, globalFields Fields) *StandardLogger
NewStandardLogger initializes a new StandardLogger object and returns it. output is the output that the log messages are written to. globalFields are the fields that are written in every log message.
func (*StandardLogger) Debug ¶
func (l *StandardLogger) Debug(fields Fields) error
Debug writes a log message at a debug level.
func (*StandardLogger) Error ¶
func (l *StandardLogger) Error(fields Fields) error
Error writes a log message at an error level.
func (*StandardLogger) Info ¶
func (l *StandardLogger) Info(fields Fields) error
Info writes a log message at an info level.