v0.9.0 restructure for flow architecture, dirty
This commit is contained in:
@@ -15,20 +15,19 @@ type RawFormatter struct {
|
||||
}
|
||||
|
||||
// NewRawFormatter creates a new raw pass-through formatter.
|
||||
func NewRawFormatter(cfg *config.RawFormatterOptions, logger *log.Logger) (*RawFormatter, error) {
|
||||
func NewRawFormatter(opts *config.RawFormatterOptions, logger *log.Logger) (*RawFormatter, error) {
|
||||
return &RawFormatter{
|
||||
config: cfg,
|
||||
config: opts,
|
||||
logger: logger,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Format returns the raw message from the LogEntry as a byte slice.
|
||||
func (f *RawFormatter) Format(entry core.LogEntry) ([]byte, error) {
|
||||
// TODO: Standardize not to add "\n" when processing raw, check lixenwraith/log for consistency
|
||||
if f.config.AddNewLine {
|
||||
return append([]byte(entry.Message), '\n'), nil
|
||||
return append([]byte(entry.Message), '\n'), nil // Add back the trimmed new line
|
||||
} else {
|
||||
return []byte(entry.Message), nil
|
||||
return []byte(entry.Message), nil // New line between log entries are trimmed
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user