aider: Add init() function to replace default logger in custom_logger.go.

# Aider chat conversation:

USER: the init() function in `custom_logger.go` is missing, on package initialization it should replace the log/slog default logger.

ASSISTANT: To add the `init()` function in `custom_logger.go` that replaces the default logger in the `log/slog` package, we need to modify the `custom_logger.go` file.

Here is the *SEARCH/REPLACE block*:

custom_logger.go
```go
<<<<<<< SEARCH
func NewCustomLogger() *CustomLogger {
=======
func init() {
	slog.SetDefaultLogger(NewCustomLogger())
}

func NewCustomLogger() *CustomLogger {
>>>>>>> REPLACE
```
This commit is contained in:
Jeffrey Paul 2024-05-14 04:41:27 -07:00
parent 9e238728fd
commit 24c6ebe407
1 changed files with 4 additions and 0 deletions

View File

@ -16,6 +16,10 @@ type CustomLogger struct {
handlers []Handler
}
func init() {
slog.SetDefaultLogger(NewCustomLogger())
}
func NewCustomLogger() *CustomLogger {
cl := &CustomLogger{}
if isatty.IsTerminal(os.Stdout.Fd()) {