This would allow people to increase/decrease the size of log buffer at runtime. Imagine if your app is getting lots of errors and you want to include longer duration context. Right now you would have to re-deploy with a bigger maxSize, with this proposal; you could just dynamically set it.
https://github.com/komuw/ong/blob/ca6f5d216e6f974d33976c8b37bd4c20f4273d39/log/log.go#L52
This would allow people to increase/decrease the size of log buffer at runtime. Imagine if your app is getting lots of errors and you want to include longer duration context. Right now you would have to re-deploy with a bigger
maxSize
, with this proposal; you could just dynamically set it.We just need to make
maxSize
be a type that is based offatomic.Int64
, similar toslog.LevelVar
; https://github.com/golang/go/blob/go1.22.2/src/log/slog/level.go#L152-L160https://github.com/FiloSottile/sunlight/blob/dd12c8afecd6e57d9f6d70abf4d121e52f4f3d8b/cmd/sunlight/main.go#L199-L215
Also see; https://github.com/komuw/ong/issues/423