Skip to content

Commit 896f05d

Browse files
committed
Make all log message use a prefix to aid grepping
1 parent 3ed7d4a commit 896f05d

File tree

1 file changed

+30
-36
lines changed

1 file changed

+30
-36
lines changed

package/oracledbinstall.js

Lines changed: 30 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,17 @@
2121
* DESCRIPTION
2222
* This script is included in the npm bundle of node-oracledb. It
2323
* is invoked by package.json during npm install. It downloads a
24-
* pre-built node-oracleb binary if one is available, or gives a
25-
* message on how to compile from source code.
24+
* pre-built node-oracleb binary from GitHub if one is available, or
25+
* gives a message on how to compile one from source code.
2626
*
27+
* MAINTENANCE NOTES
28+
* - This file should run with Node 4 or later.
29+
* - This file should only ever 'require' packages included in core Node.js.
30+
*
2731
*****************************************************************************/
2832

2933
'use strict';
3034

31-
/* Install script for the oracledb add-on.
32-
*
33-
* This script downloads an oracledb.node binary over HTTPS.
34-
*
35-
* Maintenance note:
36-
* - This file should only ever 'require' packages included in core Node.js.
37-
* - This file should run with Node 4 or later.
38-
*
39-
* When a GitHub 'release' is made, binaries can be uploaded to
40-
* GitHub. They will be located in:
41-
* https://github.com/oracle/node-oracledb/releases/download/<tag>/<filename>
42-
*/
43-
4435
const http = require('http');
4536
const https = require('https');
4637
const fs = require('fs');
@@ -59,6 +50,8 @@ try {
5950
return;
6051
}
6152

53+
// Note: the Makefile uses these hostname and path values for the npm
54+
// package but will substitute them for the staging package
6255
const PACKAGE_HOSTNAME = 'github.com';
6356
const PACKAGE_PATH_REMOTE = '/oracle/node-oracledb/releases/download/' + packageUtil.dynamicProps.GITHUB_TAG + '/' + packageUtil.dynamicProps.PACKAGE_FILE_NAME;
6457
const SHA_PATH_REMOTE = '/oracle/node-oracledb/releases/download/' + packageUtil.dynamicProps.GITHUB_TAG + '/' + packageUtil.SHA_FILE_NAME;
@@ -358,16 +351,17 @@ function done(err, alreadyInstalled) {
358351
arch = '32-bit';
359352
}
360353

361-
console.log('\n********************************************************************************');
354+
packageUtil.log('');
355+
packageUtil.log('********************************************************************************');
362356

363357
if (alreadyInstalled) {
364-
console.log('** Node-oracledb ' + packageUtil.dynamicProps.PACKAGE_JSON_VERSION + ' was already installed for Node.js ' + process.versions.node + ' (' + process.platform + ', ' + process.arch +')');
358+
packageUtil.log('** Node-oracledb ' + packageUtil.dynamicProps.PACKAGE_JSON_VERSION + ' was already installed for Node.js ' + process.versions.node + ' (' + process.platform + ', ' + process.arch +')');
365359
} else {
366-
console.log('** Node-oracledb ' + packageUtil.dynamicProps.PACKAGE_JSON_VERSION + ' installation complete for Node.js ' + process.versions.node + ' (' + process.platform + ', ' + process.arch +')');
360+
packageUtil.log('** Node-oracledb ' + packageUtil.dynamicProps.PACKAGE_JSON_VERSION + ' installation complete for Node.js ' + process.versions.node + ' (' + process.platform + ', ' + process.arch +')');
367361
}
368362

369-
console.log('**');
370-
console.log('** To use the installed node-oracledb:');
363+
packageUtil.log('**');
364+
packageUtil.log('** To use the installed node-oracledb:');
371365

372366
if (process.platform === 'linux') {
373367
if (process.arch === 'x64') {
@@ -376,37 +370,37 @@ function done(err, alreadyInstalled) {
376370
clientUrl = 'http://www.oracle.com/technetwork/topics/linuxsoft-082809.html';
377371
}
378372

379-
console.log('** - You must have ' + arch + ' Oracle client libraries in LD_LIBRARY_PATH, or configured with ldconfig');
380-
console.log('** - If you do not already have libraries, install the Instant Client Basic or Basic Light package from ');
381-
console.log('** ' + clientUrl);
373+
packageUtil.log('** - You must have ' + arch + ' Oracle client libraries in LD_LIBRARY_PATH, or configured with ldconfig');
374+
packageUtil.log('** - If you do not already have libraries, install the Instant Client Basic or Basic Light package from ');
375+
packageUtil.log('** ' + clientUrl);
382376
} else if (process.platform === 'darwin') {
383377
clientUrl = 'http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html';
384378

385-
console.log('** - You need to have the Oracle Instant Client Basic or Basic Light package in ~/lib or /usr/local/lib');
386-
console.log('** Download from ' + clientUrl);
379+
packageUtil.log('** - You need to have the Oracle Instant Client Basic or Basic Light package in ~/lib or /usr/local/lib');
380+
packageUtil.log('** Download from ' + clientUrl);
387381
} else if (process.platform === 'win32') {
388382
if (process.arch === 'x64') {
389383
clientUrl = 'http://www.oracle.com/technetwork/topics/winx64soft-089540.html';
390384
} else {
391385
clientUrl = 'http://www.oracle.com/technetwork/topics/winsoft-085727.html';
392386
}
393387

394-
console.log('** - You must have ' + arch + ' Oracle client libraries in your PATH environment variable');
395-
console.log('** - If you do not already have libraries, install the Instant Client Basic or Basic Light package from');
396-
console.log('** ' + clientUrl);
397-
console.log('** - A Microsoft Visual Studio Redistributable suitable for your Oracle client library version must be available');
398-
console.log('** Check ' + installUrl + ' for details');
388+
packageUtil.log('** - You must have ' + arch + ' Oracle client libraries in your PATH environment variable');
389+
packageUtil.log('** - If you do not already have libraries, install the Instant Client Basic or Basic Light package from');
390+
packageUtil.log('** ' + clientUrl);
391+
packageUtil.log('** - A Microsoft Visual Studio Redistributable suitable for your Oracle client library version must be available');
392+
packageUtil.log('** Check ' + installUrl + ' for details');
399393
} else {
400394
clientUrl = 'http://www.oracle.com/technetwork/database/features/instant-client/index-100365.html';
401395

402-
console.log('** - You must have ' + arch + ' Oracle client libraries in your operating system library search path');
403-
console.log('** - If you do not already have libraries, install an Instant Client Basic or Basic Light package from: ');
404-
console.log('** ' + clientUrl);
396+
packageUtil.log('** - You must have ' + arch + ' Oracle client libraries in your operating system library search path');
397+
packageUtil.log('** - If you do not already have libraries, install an Instant Client Basic or Basic Light package from: ');
398+
packageUtil.log('** ' + clientUrl);
405399
}
406400

407-
console.log('**');
408-
console.log('** Node-oracledb installation instructions: ' + installUrl);
409-
console.log('********************************************************************************\n');
401+
packageUtil.log('**');
402+
packageUtil.log('** Node-oracledb installation instructions: ' + installUrl);
403+
packageUtil.log('********************************************************************************\n');
410404
}
411405
}
412406

0 commit comments

Comments
 (0)