Added structure to data manager log entries, grouping similar fields.
authormishaz <misha@curoverse.com>
Thu, 8 Jan 2015 22:35:37 +0000 (22:35 +0000)
committerTom Clegg <tom@curoverse.com>
Fri, 13 Feb 2015 21:23:54 +0000 (16:23 -0500)
services/datamanager/collection/collection.go
services/datamanager/datamanager.go

index b2fcd5c2823c08e09aca76b518c64db2dcd9cde8..c64160cac0c9fe96dca349c5997c156210cabf4d 100644 (file)
@@ -125,7 +125,9 @@ func GetCollections(params GetCollectionsParams) (results ReadCollections) {
 
        if params.Logger != nil {
                properties,_ := params.Logger.Edit()
-               properties["num_collections_at_start"] = initialNumberOfCollectionsAvailable
+               collectionInfo := make(map[string]interface{})
+               collectionInfo["num_collections_at_start"] = initialNumberOfCollectionsAvailable
+               properties["collection_info"] = collectionInfo
                params.Logger.Record()
        }
 
@@ -164,10 +166,11 @@ func GetCollections(params GetCollectionsParams) (results ReadCollections) {
 
                if params.Logger != nil {
                        properties,_ := params.Logger.Edit()
-                       properties["collections_read"] = totalCollections
-                       properties["latest_modified_date"] = sdkParams["filters"].([][]string)[0][2]
-                       properties["total_manifest_size"] = totalManifestSize
-                       properties["max_manifest_size"] = maxManifestSize
+                       collectionInfo := properties["collection_info"].(map[string]interface{})
+                       collectionInfo["collections_read"] = totalCollections
+                       collectionInfo["latest_modified_date"] = sdkParams["filters"].([][]string)[0][2]
+                       collectionInfo["total_manifest_size"] = totalManifestSize
+                       collectionInfo["max_manifest_size"] = maxManifestSize
                        params.Logger.Record()
                }
        }
index b0ce1a77228b2e89507bc0bb6312cc320145d575..dc6a431a87175008b8ba41b62480005912c59e5c 100644 (file)
@@ -53,14 +53,17 @@ func main() {
 
        if arvLogger != nil {
                properties, _ := arvLogger.Edit()
-               properties["start_time"] = time.Now()
-               properties["args"] = os.Args
+               runInfo := make(map[string]interface{})
+               runInfo["start_time"] = time.Now()
+               runInfo["args"] = os.Args
                hostname, err := os.Hostname()
                if err != nil {
-                       properties["hostname_error"] = err.Error()
+                       runInfo["hostname_error"] = err.Error()
                } else {
-                       properties["hostname"] = hostname
+                       runInfo["hostname"] = hostname
                }
+               runInfo["pid"] = os.Getpid()
+               properties["run_info"] = runInfo
                arvLogger.Record()
        }