VOL-1247 : Modified change tuple to include previous and latest data

VOL-1214 : Fixed logs to use the proper mechanism

- Added missing license
- Moved one change tuple statement which would not include proper info

Change-Id: I5a02f6fe92c8b193642294d62f4413ac6edc0c62
diff --git a/db/model/data_revision.go b/db/model/data_revision.go
index 7918c14..9bf840d 100644
--- a/db/model/data_revision.go
+++ b/db/model/data_revision.go
@@ -21,6 +21,7 @@
 	"encoding/json"
 	"fmt"
 	"github.com/golang/protobuf/proto"
+	"github.com/opencord/voltha-go/common/log"
 	"reflect"
 )
 
@@ -42,7 +43,7 @@
 
 	if IsProtoMessage(data) {
 		if pbdata, err := proto.Marshal(data.(proto.Message)); err != nil {
-			fmt.Errorf("problem to marshal protobuf data --> err: %s", err.Error())
+			log.Errorf("problem to marshal protobuf data --> err: %s", err.Error())
 		} else {
 			buffer.Write(pbdata)
 		}
@@ -50,7 +51,7 @@
 	} else if reflect.ValueOf(data).IsValid() {
 		dataObj := reflect.New(reflect.TypeOf(data).Elem())
 		if json, err := json.Marshal(dataObj.Interface()); err != nil {
-			fmt.Errorf("problem to marshal data --> err: %s", err.Error())
+			log.Errorf("problem to marshal data --> err: %s", err.Error())
 		} else {
 			buffer.Write(json)
 		}