Skip to content

Commit

Permalink
remove console.logs
Browse files Browse the repository at this point in the history
Signed-off-by: Johnny On <[email protected]>
  • Loading branch information
johnnyon-amzn committed May 17, 2022
1 parent 9fec626 commit 020a633
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 21 deletions.
2 changes: 0 additions & 2 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const CONFIG_PATH = path.join(__dirname, "config.json");
function getConfig(name, configPath=CONFIG_PATH) {
let config = fs.readFileSync(configPath);
config = JSON.parse(config.toString());
console.log('config', config);
if (name) {
return config[name] || {};
} else {
Expand All @@ -14,7 +13,6 @@ function getConfig(name, configPath=CONFIG_PATH) {
}

function setConfig(config, callback, configPath=CONFIG_PATH) {
console.log('config', config)
let oldConfig = fs.readFileSync(configPath);
oldConfig = JSON.parse(oldConfig.toString());
oldConfig[config.NAME] = config;
Expand Down
2 changes: 0 additions & 2 deletions src/configRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ function addListeners() {
let submit = document.getElementById("submit");
submit.addEventListener("click", async (event) => {
event.preventDefault();
console.log('click');
let newConfig = getNewConfig();
console.log('newConfig', newConfig);
window.electron.setConfig(newConfig, closeWindow);
})
}
Expand Down
13 changes: 0 additions & 13 deletions src/dashboards.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ async function getOSDStatus() {
try {
const osStatus = await apiRequest('localhost:9200');
const osdStatus = await apiRequest('localhost:5601/api/status');
console.log('osStatus', osStatus)
console.log('osdStatus', osdStatus);
if (osStatus.name) {
statuses["os"] = "green"
}
Expand All @@ -24,7 +22,6 @@ async function getOSDStatus() {
statuses["osd"] = osdStatus.status.overall.state;
}
} catch (e) {
console.log('e', e);
}

return statuses;
Expand All @@ -39,7 +36,6 @@ async function getOSDStatus() {
}

async function startProxy(config) {
console.log('config Proxy', config);
//export variables in command line
for (let variable in config) {
process.env[variable] = config[variable];
Expand All @@ -50,37 +46,28 @@ async function startProxy(config) {

proxy.stdout.on('data', function(data) {
data = JSON.parse(data.toString());
//console.log('stdout: ' + JSON.stringify(data));
})

proxy.stderr.on('data', function(data) {
//console.log('stderr: ' + data.toString());
})

proxy.on('exit', function(code) {
console.log('child process exited with code ' + code.toString());
})
return;
}

async function startOSD(config) {
console.log('config', config);
//start osd
var osd = spawn(config.OSD_PATH + '/bin/opensearch-dashboards');

osd.stdout.on('data', function(data) {
data = JSON.parse(data.toString());
console.log('stdout: ' + JSON.stringify(data));
})

osd.stderr.on('data', function(data) {

console.log('stderr: ' + data.toString());
})

osd.on('exit', function(code) {
console.log('child process exited with code ' + code.toString());

})
}

Expand Down
3 changes: 0 additions & 3 deletions src/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ async function populateFields() {
function getActiveConfig() {
let profile = document.getElementById("profile");
var name = profile.options[profile.selectedIndex].value;
console.log('name', name);
return config[name] || null;
}

Expand All @@ -51,8 +50,6 @@ function addListeners() {

//get active profile config
let activeConfig = getActiveConfig();
console.log(activeConfig);

await window.electron.startProxy(activeConfig);
await window.electron.startOSD(activeConfig);
waitForServer();
Expand Down
1 change: 0 additions & 1 deletion test/jest/dashboard.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ describe('Config Test', () => {
let value = Math.floor(Math.random() * 1000);
await dashboards.setConfig(map, value, ()=>{}, CONFIG_TEST_PATH);
let config = await dashboards.getConfig(CONFIG_TEST_PATH);
console.log('config', config);
expect(config[map]).toEqual(value);
})

Expand Down

0 comments on commit 020a633

Please sign in to comment.