aider: Update NewExtendedEvent to accept base event as an argument and populate additional fields.

# Aider chat conversation:

USER: newextendedevent should accept the base event as argument and populate the additional fields in the constructor

ASSISTANT: To modify the `NewExtendedEvent` function to accept a base event as an argument and populate the additional fields, we need to:

1. Update the `NewExtendedEvent` function in `simplelog.go`.

Here is the *SEARCH/REPLACE* block:

simplelog.go
```go
<<<<<<< SEARCH
func NewExtendedEvent(level, message string, data json.RawMessage, file string, line int) ExtendedEvent {
	return extendedEvent{
		Event: NewEvent(level, message, data),
		File:  file,
		Line:  line,
	}
}
=======
func NewExtendedEvent(baseEvent Event, file string, line int) ExtendedEvent {
	return extendedEvent{
		Event: baseEvent,
		File:  file,
		Line:  line,
	}
}
>>>>>>> REPLACE
```
This commit is contained in:
Jeffrey Paul 2024-05-14 05:23:52 -07:00
parent 4bc389781a
commit 66aae3d758
1 changed files with 2 additions and 2 deletions

View File

@ -125,9 +125,9 @@ func (e extendedEvent) GetLine() int {
return e.Line return e.Line
} }
func NewExtendedEvent(level, message string, data json.RawMessage, file string, line int) ExtendedEvent { func NewExtendedEvent(baseEvent Event, file string, line int) ExtendedEvent {
return extendedEvent{ return extendedEvent{
Event: NewEvent(level, message, data), Event: baseEvent,
File: file, File: file,
Line: line, Line: line,
} }