@@ -14,7 +14,7 @@ import (
1414)
1515
1616// CreateLog creates a new log in the database.
17- func (e * engine ) CreateLog (l * library.Log ) ( * library. Log , error ) {
17+ func (e * engine ) CreateLog (l * library.Log ) error {
1818 // check what the log entry is for
1919 switch {
2020 case l .GetServiceID () > 0 :
@@ -33,7 +33,7 @@ func (e *engine) CreateLog(l *library.Log) (*library.Log, error) {
3333 // https://pkg.go.dev/github.com/go-vela/types/database#Log.Validate
3434 err := log .Validate ()
3535 if err != nil {
36- return nil , err
36+ return err
3737 }
3838
3939 // compress log data for the resource
@@ -43,14 +43,15 @@ func (e *engine) CreateLog(l *library.Log) (*library.Log, error) {
4343 if err != nil {
4444 switch {
4545 case l .GetServiceID () > 0 :
46- return nil , fmt .Errorf ("unable to compress log for service %d for build %d: %w" , l .GetServiceID (), l .GetBuildID (), err )
46+ return fmt .Errorf ("unable to compress log for service %d for build %d: %w" , l .GetServiceID (), l .GetBuildID (), err )
4747 case l .GetStepID () > 0 :
48- return nil , fmt .Errorf ("unable to compress log for step %d for build %d: %w" , l .GetStepID (), l .GetBuildID (), err )
48+ return fmt .Errorf ("unable to compress log for step %d for build %d: %w" , l .GetStepID (), l .GetBuildID (), err )
4949 }
5050 }
5151
5252 // send query to the database
53- result := e .client .Table (constants .TableLog ).Create (log )
54-
55- return log .ToLibrary (), result .Error
53+ return e .client .
54+ Table (constants .TableLog ).
55+ Create (log ).
56+ Error
5657}
0 commit comments