Start implementing a logger

This commit is contained in:
Nikolai Rodionov 2024-05-06 11:46:23 +02:00
parent bcd62301e3
commit 58065228e7
Signed by: allanger
GPG Key ID: 0AA46A90E25592AD

View File

@ -192,13 +192,17 @@ func (e *EnvironmentsServer) Get(ctx context.Context, in *proto.GetOptions) (*pr
}
func (e *EnvironmentsServer) List(in *proto.ListOptions, stream proto.Environments_ListServer) error {
log := e.logInstance
log.WithValues("user_id", in.GetOwnerId().GetUuid())
ctx := logr.NewContext(stream.Context(), log)
environment := &controllers.Environemnt{
UserID: in.GetOwnerId().GetUuid(),
Controller: e.controller,
Token: in.GetToken().GetToken(),
}
envs, err := environment.ListEnvs(stream.Context(), in.GetSearchString())
envs, err := environment.ListEnvs(ctx, in.GetSearchString())
if err != nil {
return err
}