Skip to content

Commit acc90cf

Browse files
Manoj S KManoj S K
Manoj S K
authored and
Manoj S K
committed
add version information in both schemas and json log file
1 parent cfe16c6 commit acc90cf

10 files changed

+41
-0
lines changed

docs/schemas/babel.schema

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"$schema": "http://json-schema.org/schema#",
33
"type": "object",
44
"properties": {
5+
"version" : {
6+
"type": "string",
7+
"const": "1.0"
8+
},
59
"babel": {
610
"type": "object",
711
"additionalProperties": {

docs/schemas/gpup.schema

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"$schema": "http://json-schema.org/schema#",
33
"type": "object",
44
"properties": {
5+
"version" : {
6+
"type": "string",
7+
"const": "1.0"
8+
},
59
"gpup": {
610
"type": "object",
711
"additionalProperties": {

docs/schemas/gst.schema

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"$schema": "http://json-schema.org/schema#",
33
"type": "object",
44
"properties": {
5+
"version" : {
6+
"type": "string",
7+
"const": "1.0"
8+
},
59
"gst": {
610
"type": "object",
711
"additionalProperties": {

docs/schemas/iet.schema

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"$schema": "http://json-schema.org/schema#",
33
"type": "object",
44
"properties": {
5+
"version" : {
6+
"type": "string",
7+
"const": "1.0"
8+
},
59
"iet": {
610
"type": "object",
711
"additionalProperties": {

docs/schemas/mem.schema

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"$schema": "http://json-schema.org/schema#",
33
"type": "object",
44
"properties": {
5+
"version" : {
6+
"type": "string",
7+
"const": "1.0"
8+
},
59
"mem": {
610
"type": "object",
711
"properties": {

docs/schemas/pbqt.schema

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"$schema": "http://json-schema.org/schema#",
33
"type": "object",
44
"properties": {
5+
"version" : {
6+
"type": "string",
7+
"const": "1.0"
8+
},
59
"pbqt": {
610
"type": "object",
711
"additionalProperties": {

docs/schemas/pebb.schema

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"$schema": "http://json-schema.org/schema#",
33
"type": "object",
44
"properties": {
5+
"version" : {
6+
"type": "string",
7+
"const": "1.0"
8+
},
59
"pebb": {
610
"type": "object",
711
"additionalProperties": {

docs/schemas/peqt.schema

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"$schema": "http://json-schema.org/schema#",
33
"type": "object",
44
"properties": {
5+
"version" : {
6+
"type": "string",
7+
"const": "1.0"
8+
},
59
"peqt": {
610
"type": "object",
711
"additionalProperties": {

docs/schemas/tst.schema

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"$schema": "http://json-schema.org/schema#",
33
"type": "object",
44
"properties": {
5+
"version" : {
6+
"type": "string",
7+
"const": "1.0"
8+
},
59
"tst": {
610
"type": "object",
711
"additionalProperties": {

src/rvsliblogger.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ const char* rvs::logger::loglevelname[] = {
6969

7070
// Json specific consts
7171
const std::string node_start{"{"};
72+
const std::string version_key{"version"};
73+
const std::string version_val{"1.0"};
7274
const std::string node_end{"}"};
7375
const std::string kv_delimit{":"};
7476
const std::string list_start{"["};
@@ -393,6 +395,9 @@ int rvs::logger::JsonStartNodeCreate(const char* Module, const char* Action) {
393395
std::cout << "json log file is " << json_log_file<< std::endl;
394396
}
395397
std::string row{node_start};
398+
row += newline;
399+
row += std::string("\"") + version_key + std::string("\"") +kv_delimit ;
400+
row += std::string("\"") + version_val + std::string("\"") + "," + newline;
396401
row += std::string("\"") + Module + std::string("\"") + kv_delimit + node_start + newline;
397402
std::lock_guard<std::mutex> lk(json_log_mutex);
398403
return ToFile(row, true);

0 commit comments

Comments
 (0)