Skip to content

Commit e234dd9

Browse files
authored
Merge pull request #307 from openBackhaul/latta-siae/issue237
Latta siae/issue237
2 parents d9aac90 + 9a8ebdb commit e234dd9

File tree

12 files changed

+330
-246
lines changed

12 files changed

+330
-246
lines changed

server/controllers/IndividualServices.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ module.exports.readCurrentMacTableFromDevice = async function readCurrentMacTabl
110110
let startTime = process.hrtime();
111111
let responseCode = responseCodeEnum.code.OK;
112112
let responseBodyToDocument = {};
113-
114-
await IndividualServices.readCurrentMacTableFromDevice(body, user, originator, xCorrelator, traceIndicator, customerJourney, req.url)
113+
await IndividualServices.readCurrentMacTableFromDevice(body, user, originator, xCorrelator, traceIndicator, customerJourney)
115114
.then(async function (responseBody) {
116115
responseBodyToDocument = responseBody;
117116
let responseHeader = await ResponseHeader.createResponseHeader(xCorrelator, startTime, req.url);

server/index.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const cp = require('./service/individualServices/CyclicProcessService/cyclicProcess');
2+
const logger = require('./service/LoggingService.js').getLogger();
23

34
'use strict';
45

@@ -15,14 +16,14 @@ const { env } = require('process');
1516
// uncomment if you do not want to validate security e.g. operation-key, basic auth, etc
1617
//appCommons.openApiValidatorOptions.validateSecurity = false;
1718
if (process.env.DEBUG && process.env.DEBUG.toLowerCase() === "true") {
18-
console.warn("Working in debug mode");
19-
console.warn("Checking validation")
19+
logger.warn("Working in debug mode");
20+
logger.warn("Checking validation")
2021
appCommons.openApiValidatorOptions.validateSecurity = false;
2122
// appCommons.openApiValidatorOptions.validateResponses = false;
2223
// appCommons.openApiValidatorOptions.validateRequests = false;
23-
console.warn("Validate Security: " + appCommons.openApiValidatorOptions.validateSecurity);
24-
console.warn("Validate Responses: " + appCommons.openApiValidatorOptions.validateResponses);
25-
console.warn("Validate Requests: " + appCommons.openApiValidatorOptions.validateRequests);
24+
logger.warn("Validate Security: " + appCommons.openApiValidatorOptions.validateSecurity);
25+
logger.warn("Validate Responses: " + appCommons.openApiValidatorOptions.validateResponses);
26+
logger.warn("Validate Requests: " + appCommons.openApiValidatorOptions.validateRequests);
2627
}
2728

2829
// swaggerRouter configuration
@@ -39,19 +40,19 @@ appCommons.setupExpressApp(app);
3940

4041
global.databasePath = './database/load.json'
4142
if (process.env.DEBUG && process.env.DEBUG.toLowerCase() === "true") {
42-
console.warn("Working in debug mode");
43+
logger.warn("Working in debug mode");
4344
global.databasePath = './server/database/load.json'
44-
console.warn("Load data from: " + global.databasePath)
45+
logger.warn("Load data from: " + global.databasePath)
4546
}
4647

4748
prepareElasticsearch().catch(err => {
48-
console.error(`Error preparing Elasticsearch : ${err}`);
49+
logger.error(`Error preparing Elasticsearch : ${err}`);
4950
}).finally(
5051
() => {
5152
// Initialize the Swagger middleware
5253
http.createServer(app).listen(serverPort, function () {
53-
console.log('Your server is listening on port %d (http://localhost:%d)', serverPort, serverPort);
54-
console.log('Swagger-ui is available on http://localhost:%d/docs', serverPort);
54+
logger.info('Your server is listening on port %d (http://localhost:%d)', serverPort, serverPort);
55+
logger.info('Swagger-ui is available on http://localhost:%d/docs', serverPort);
5556
});
5657
appCommons.performApplicationRegistration();
5758

server/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
"oas3-tools": "^2.2.3",
1919
"onf-core-model-ap": "2.1.2",
2020
"onf-core-model-ap-bs": "2.1.2",
21-
"openbackhaul-oas3-tools": "2.3.1-alpha.3"
21+
"openbackhaul-oas3-tools": "2.3.1-alpha.3",
22+
"pino": "^9.4.0",
23+
"pino-pretty": "^11.2.2",
24+
"pino-roll": "^2.2.0"
2225
}
2326
}

server/service/HttpClientService.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
'use strict';
2+
3+
// ONF Libs
24
var fileOperation = require('onf-core-model-ap/applicationPattern/databaseDriver/JSONDriver');
3-
const prepareForwardingAutomation = require('./individualServices/PrepareForwardingAutomation');
45
const ForwardingAutomationService = require('onf-core-model-ap/applicationPattern/onfModel/services/ForwardingConstructAutomationServices');
56
const httpClientInterface = require('onf-core-model-ap/applicationPattern/onfModel/models/layerProtocols/HttpClientInterface');
67

8+
// Custom imports
9+
const prepareForwardingAutomation = require('./individualServices/PrepareForwardingAutomation');
710

811
/**
912
* Returns name of application to be addressed

0 commit comments

Comments
 (0)