slnodejs 6.1.1065 → 6.1.1066

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/preload.js +10 -8
  2. package/package.json +1 -1
package/lib/preload.js CHANGED
@@ -1,16 +1,19 @@
1
1
  const { resolve } = require('node:path');
2
2
  const { spawnSync } = require('node:child_process');
3
+ const { LoggerFactory} = require('../tsOutputs/common/logger')
4
+
5
+ const logger = LoggerFactory.getCreateApplicationLogger();
3
6
 
4
7
  function main() {
5
8
  if (process.env.PRELOAD_EXECUTED) {
6
- console.log('Skipping preload logic on subsequent entry');
9
+ logger.info('Skipping preload logic on subsequent entry');
7
10
  return;
8
11
  }
9
12
 
10
13
  process.env.PRELOAD_EXECUTED = 1;
11
14
 
12
15
  if (require.main === module) {
13
- console.log('preload.js is the main module, exiting.');
16
+ logger.info('preload.js is the main module, exiting.');
14
17
  process.exit(0);
15
18
  }
16
19
 
@@ -41,21 +44,20 @@ function main() {
41
44
  .filter(x => x); // remove unset arguments
42
45
  const processArgs = [pathToSlAgentCli, ...args];
43
46
  process.env.NODE_OPTIONS = '';
44
- process.env.NODE_DEBUG = 'sl';
45
47
 
46
48
  try {
47
- console.info('Rerun main module with args - ', processArgs);
49
+ logger.info(`Rerun main module with args - ${JSON.stringify(processArgs)}`);
48
50
  const result = spawnSync(process.argv[0], processArgs, { stdio: 'inherit', shell: false });
49
51
  if (result.error) {
50
52
  throw result.error;
51
53
  }
52
54
  process.exit(result.status);
53
55
  } catch (error) {
54
- console.error('Error occurred while executing the target script:', error);
55
- console.info('Run main module with original args - ', originalArgv);
56
+ logger.error('Error occurred while executing the target script:', error);
57
+ logger.info('Run main module with original args - ', originalArgv);
56
58
  const result = spawnSync(argv0, originalArgv.split(' '), { stdio: 'inherit', shell: false });
57
59
  if (result.error) {
58
- console.error('Error occurred while executing the original script:', result.error);
60
+ logger.error('Error occurred while executing the original script:', result.error);
59
61
  process.exit(1);
60
62
  }
61
63
  process.exit(result.status);
@@ -63,7 +65,7 @@ function main() {
63
65
  }
64
66
 
65
67
  process.on('uncaughtException', (error) => {
66
- console.error('Uncaught Exception:', error);
68
+ logger.error('Uncaught Exception:', error);
67
69
  process.exit(1);
68
70
  });
69
71
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slnodejs",
3
- "version": "6.1.1065",
3
+ "version": "6.1.1066",
4
4
  "description": "",
5
5
  "main": "tsOutputs/api.js",
6
6
  "workspaces": [