opticore-webapp 1.0.1 → 1.0.3
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.
- package/dist/index.cjs +184 -293
- package/dist/index.js +184 -293
- package/package.json +2 -2
- package/src/core/events/errors/serverListen.event.error.ts +157 -243
- package/src/core/events/requestCalls.event.ts +0 -3
- package/tsup.config.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -108,36 +108,14 @@ import EventEmitter from "node:events";
|
|
|
108
108
|
|
|
109
109
|
// src/core/events/errors/serverListen.event.error.ts
|
|
110
110
|
import process from "process";
|
|
111
|
-
import
|
|
111
|
+
import colors2 from "ansi-colors";
|
|
112
112
|
import chalk from "chalk";
|
|
113
113
|
|
|
114
|
-
// src/core/utils/logMessage.utils.ts
|
|
115
|
-
import colors from "ansi-colors";
|
|
116
|
-
|
|
117
114
|
// src/core/utils/dateTimeFormatted.utils.ts
|
|
118
115
|
var dateTimeFormattedUtils = `${(/* @__PURE__ */ new Date()).getMonth()}-${(/* @__PURE__ */ new Date()).getDate()}-${(/* @__PURE__ */ new Date()).getFullYear()} ${(/* @__PURE__ */ new Date()).getHours()}:${(/* @__PURE__ */ new Date()).getMinutes()}:${(/* @__PURE__ */ new Date()).getSeconds()}`;
|
|
119
116
|
|
|
120
|
-
// src/core/utils/logMessage.utils.ts
|
|
121
|
-
var LogMessageUtils = class {
|
|
122
|
-
static success(title, action, contentAction) {
|
|
123
|
-
console.log(`${colors.green(`\u2714`)} ${colors.bgGreen(` ${colors.bold(`${colors.white(`${title}`)}`)} `)} ${dateTimeFormattedUtils} | ${colors.bgGreen(`${colors.white(` Success `)}`)} [ ${action} ] ${contentAction} - [ Status ] ${colors.bgGreen(`${colors.white(` 200 `)}`)}`);
|
|
124
|
-
}
|
|
125
|
-
static warning(title, action, contentAction) {
|
|
126
|
-
console.warn(`${colors.yellow(`\u26A0\uFE0F`)} ${colors.bgYellow(` ${colors.bold(`${colors.white(`${title}`)}`)} `)} ${dateTimeFormattedUtils} | ${colors.bgYellow(`${colors.white(` Warning `)}`)} ${contentAction}`);
|
|
127
|
-
}
|
|
128
|
-
static info(title, action, contentAction) {
|
|
129
|
-
console.info(`${colors.cyan(`\u24D8`)} ${colors.bgCyan(` ${colors.bold(`${colors.white(`${title}`)}`)} `)} ${dateTimeFormattedUtils} | ${colors.bgCyan(`${colors.white(` Info `)}`)} ${contentAction}`);
|
|
130
|
-
}
|
|
131
|
-
static error(title, errorType, stackTrace, messageContent, httpCodeValue) {
|
|
132
|
-
console.error(`${colors.red(`\u2718`)} ${colors.bgRed(` ${colors.bold(`${colors.white(`${title}`)}`)} `)} | ${dateTimeFormattedUtils} | [ ${colors.red(`${colors.bold(` ${errorType} `)}`)} ] | [ ${colors.bold(`stack trace`)} ] ${colors.red(`${stackTrace}`)} - ${colors.red(`${messageContent}`)} - [ ${colors.red(`${colors.bold(` HttpCode `)}`)} ] ${colors.red(`${colors.bold(` ${httpCodeValue} `)}`)} `);
|
|
133
|
-
}
|
|
134
|
-
static requestError(title, errorName, errorMessage, errorCode) {
|
|
135
|
-
console.error(`[ ${colors.red(`${title}`)} ] ${dateTimeFormattedUtils} | ${colors.bgRed(`${colors.white(` ERROR `)}`)} ${colors.red(`[ ${errorName} ]`)} ${colors.red(`${errorMessage}`)} - [ Status ] ${colors.bgRed(`${colors.white(` ${errorCode} `)}`)}`);
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
|
|
139
117
|
// src/application/exceptions/messages.exception.ts
|
|
140
|
-
import
|
|
118
|
+
import colors from "ansi-colors";
|
|
141
119
|
var messageException = {
|
|
142
120
|
dbConnection: "DataBase connection",
|
|
143
121
|
dbConnectionClosed: "MySQL connection is closed",
|
|
@@ -201,7 +179,7 @@ var messageException = {
|
|
|
201
179
|
errorHost: "The host can't be empty or blank. Please define a string host in .env",
|
|
202
180
|
accessDeniedToDBCon: (user, password) => `Access denied for user ${user}. Database credentials in .env file are User: ${user} and Password: ${password}. '${user}''${password}'@'localhost'. Try to set user and password in .env file`,
|
|
203
181
|
unknownDB: (database) => `Database ${database} is unknown. Please try to use Database CLI to create your database, or do it manually in your Database Management System`,
|
|
204
|
-
errorDBHost: (host) => `A database host ${host} does not allow connection. Please either set the host like this: ${
|
|
182
|
+
errorDBHost: (host) => `A database host ${host} does not allow connection. Please either set the host like this: ${colors.bgRed(`${colors.white(`localhost`)}`)} in your .env file`
|
|
205
183
|
};
|
|
206
184
|
|
|
207
185
|
// src/domains/constants/eventNameError.constant.ts
|
|
@@ -215,384 +193,283 @@ var CEventNameError = {
|
|
|
215
193
|
};
|
|
216
194
|
|
|
217
195
|
// src/core/events/errors/serverListen.event.error.ts
|
|
196
|
+
import { LoggerCore } from "opticore-logger";
|
|
218
197
|
var ServerListenEventError = class {
|
|
198
|
+
/**
|
|
199
|
+
*
|
|
200
|
+
*/
|
|
219
201
|
static hostPortUndefined() {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
messageException.webServer,
|
|
223
|
-
messageException.badHost,
|
|
224
|
-
stackTrace.stack,
|
|
225
|
-
messageException.errorHostUrl,
|
|
226
|
-
400 /* BAD_REQUEST */
|
|
227
|
-
);
|
|
202
|
+
this.stackTrace = this.traceError(messageException.errorHostUrl, messageException.listening, 400 /* BAD_REQUEST */);
|
|
203
|
+
this.logger.error(this.stackTrace.message, messageException.webServer, messageException.badHost, this.stackTrace.stack, 400 /* BAD_REQUEST */);
|
|
228
204
|
process.exit();
|
|
229
205
|
}
|
|
206
|
+
/**
|
|
207
|
+
*
|
|
208
|
+
*/
|
|
230
209
|
static hostUndefined() {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
messageException.webServer,
|
|
234
|
-
messageException.badHost,
|
|
235
|
-
stackTrace.stack,
|
|
236
|
-
messageException.errorHost,
|
|
237
|
-
400 /* BAD_REQUEST */
|
|
238
|
-
);
|
|
210
|
+
this.stackTrace = this.traceError(messageException.badHost, messageException.listening, 400 /* BAD_REQUEST */);
|
|
211
|
+
this.logger.error(this.stackTrace.message, messageException.webServer, messageException.badHost, this.stackTrace.stack, 400 /* BAD_REQUEST */);
|
|
239
212
|
process.exit();
|
|
240
213
|
}
|
|
214
|
+
/**
|
|
215
|
+
*
|
|
216
|
+
*/
|
|
241
217
|
static portUndefined() {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
messageException.webServer,
|
|
245
|
-
messageException.badPort,
|
|
246
|
-
stackTrace.stack,
|
|
247
|
-
messageException.errorPort,
|
|
248
|
-
400 /* BAD_REQUEST */
|
|
249
|
-
);
|
|
218
|
+
this.stackTrace = this.traceError(messageException.badPort, messageException.listening, 400 /* BAD_REQUEST */);
|
|
219
|
+
this.logger.error(this.stackTrace.message, messageException.webServer, messageException.badHost, this.stackTrace.stack, 400 /* BAD_REQUEST */);
|
|
250
220
|
process.exit();
|
|
251
221
|
}
|
|
222
|
+
/**
|
|
223
|
+
*
|
|
224
|
+
* @param err
|
|
225
|
+
*/
|
|
252
226
|
static onEventError(err) {
|
|
253
|
-
|
|
254
|
-
"Server start error",
|
|
255
|
-
"Error",
|
|
256
|
-
err.stack,
|
|
257
|
-
err.message,
|
|
258
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
259
|
-
);
|
|
227
|
+
this.logger.error(err.message, "Server start error", "Error", err.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
260
228
|
}
|
|
229
|
+
/**
|
|
230
|
+
*
|
|
231
|
+
* @param error
|
|
232
|
+
*/
|
|
261
233
|
static listenerError(error) {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
error.name,
|
|
265
|
-
400 /* BAD_REQUEST */
|
|
266
|
-
);
|
|
267
|
-
LogMessageUtils.error(
|
|
268
|
-
"Event error",
|
|
269
|
-
"Error",
|
|
270
|
-
error.stack,
|
|
271
|
-
stackTrace.message,
|
|
272
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
273
|
-
);
|
|
234
|
+
this.stackTrace = this.traceError(error.message, error.name, 400 /* BAD_REQUEST */);
|
|
235
|
+
this.logger.error(this.stackTrace.message, "Event error", "Error", error.stack, 400 /* BAD_REQUEST */);
|
|
274
236
|
}
|
|
237
|
+
/**
|
|
238
|
+
*
|
|
239
|
+
* @param code
|
|
240
|
+
*/
|
|
275
241
|
static processBeforeExit(code) {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
"BeforeExit",
|
|
279
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
280
|
-
);
|
|
281
|
-
LogMessageUtils.error(
|
|
282
|
-
"BeforeExit",
|
|
283
|
-
"process before exit",
|
|
284
|
-
stackTrace.stack,
|
|
285
|
-
`Process will exit with code: ${code}`,
|
|
286
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
287
|
-
);
|
|
242
|
+
this.stackTrace = this.traceError(`Process will exit with code: ${code}`, "BeforeExit", 503 /* SERVICE_UNAVAILABLE */);
|
|
243
|
+
this.logger.error(this.stackTrace.message, "BeforeExit", "process before exit", this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
288
244
|
process.exit(code);
|
|
289
245
|
}
|
|
246
|
+
/**
|
|
247
|
+
*
|
|
248
|
+
*/
|
|
290
249
|
static processDisconnected() {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
"process disconnected",
|
|
294
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
295
|
-
);
|
|
296
|
-
LogMessageUtils.error(
|
|
297
|
-
"Disconnected",
|
|
298
|
-
"process disconnected",
|
|
299
|
-
stackTrace.stack,
|
|
300
|
-
"Child process disconnected",
|
|
301
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
302
|
-
);
|
|
250
|
+
this.stackTrace = this.traceError("Child process disconnected", "process disconnected", 503 /* SERVICE_UNAVAILABLE */);
|
|
251
|
+
this.logger.error(this.stackTrace.message, "Disconnected", "process disconnected", this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
303
252
|
process.exit();
|
|
304
253
|
}
|
|
254
|
+
/**
|
|
255
|
+
*
|
|
256
|
+
* @param code
|
|
257
|
+
*/
|
|
305
258
|
static exited(code) {
|
|
306
259
|
switch (code) {
|
|
307
260
|
case 0:
|
|
308
|
-
|
|
309
|
-
"Exited",
|
|
310
|
-
"completed",
|
|
311
|
-
"The process finished as expected and everything is ok"
|
|
312
|
-
);
|
|
261
|
+
this.logger.success("completed", "The process finished as expected and everything is ok");
|
|
313
262
|
console.log("");
|
|
314
263
|
const paddingLength = 35;
|
|
315
264
|
const msg0 = " ".padEnd(paddingLength, " ");
|
|
316
265
|
console.log(chalk.bgGreen.white(msg0.padEnd(paddingLength, " ")));
|
|
317
|
-
console.log(`${
|
|
266
|
+
console.log(`${colors2.bgGreen(` [OK] The server shutting down `)}`);
|
|
318
267
|
console.log(chalk.bgGreen.white(msg0.padEnd(paddingLength, " ")));
|
|
319
268
|
break;
|
|
320
269
|
case 1:
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
"General Errors",
|
|
324
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
325
|
-
);
|
|
326
|
-
LogMessageUtils.error(
|
|
327
|
-
"Exited",
|
|
328
|
-
"General Errors",
|
|
329
|
-
gnleStackTrace.stack,
|
|
330
|
-
"Something went wrong",
|
|
331
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
332
|
-
);
|
|
270
|
+
this.stackTrace = this.traceError("Something went wrong", "General Errors", 503 /* SERVICE_UNAVAILABLE */);
|
|
271
|
+
this.logger.error(this.stackTrace.message, "Exited", "General Errors", this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
333
272
|
break;
|
|
334
273
|
case 2:
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
"Misuse of shell builtins",
|
|
338
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
339
|
-
);
|
|
340
|
-
LogMessageUtils.error(
|
|
341
|
-
"Exited",
|
|
342
|
-
incrCmdStackTrace.name,
|
|
343
|
-
incrCmdStackTrace.stack,
|
|
344
|
-
"Incorrect using of shell commands",
|
|
345
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
346
|
-
);
|
|
274
|
+
this.stackTrace = this.traceError("Incorrect using of shell commands", "Misuse of shell builtins", 503 /* SERVICE_UNAVAILABLE */);
|
|
275
|
+
this.logger.error(this.stackTrace.message, "Exited", "Incorrect using of shell commands", this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
347
276
|
break;
|
|
348
277
|
case 126:
|
|
349
|
-
|
|
278
|
+
this.stackTrace = this.traceError(
|
|
350
279
|
"Incorrect using of shell commands",
|
|
351
|
-
"Misuse of shell builtins",
|
|
352
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
353
|
-
);
|
|
354
|
-
LogMessageUtils.error(
|
|
355
|
-
"Exited",
|
|
356
|
-
`command invoked`,
|
|
357
|
-
notExeCmdStackTrace.stack,
|
|
358
280
|
"The command is found but is not executable (e.g., trying to execute a directory)",
|
|
359
281
|
503 /* SERVICE_UNAVAILABLE */
|
|
360
282
|
);
|
|
283
|
+
this.logger.error(this.stackTrace.message, "Exited", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
361
284
|
break;
|
|
362
285
|
case 127:
|
|
363
|
-
|
|
364
|
-
"The command was not found in the system's PATH or is misspelled",
|
|
365
|
-
"Exited",
|
|
366
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
367
|
-
);
|
|
368
|
-
LogMessageUtils.error(
|
|
369
|
-
"Exited",
|
|
286
|
+
this.stackTrace = this.traceError(
|
|
370
287
|
"Command not found",
|
|
371
|
-
cmdNotFoundStackTrace.stack,
|
|
372
288
|
"The command was not found in the system's PATH or is misspelled",
|
|
373
289
|
503 /* SERVICE_UNAVAILABLE */
|
|
374
290
|
);
|
|
291
|
+
this.logger.error(this.stackTrace.message, "Exited", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
375
292
|
break;
|
|
376
293
|
case 128:
|
|
377
|
-
|
|
294
|
+
this.stackTrace = this.traceError(
|
|
378
295
|
"The command was not found in the system's PATH or is misspelled",
|
|
379
|
-
"Exited",
|
|
380
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
381
|
-
);
|
|
382
|
-
LogMessageUtils.error(
|
|
383
|
-
"Exited",
|
|
384
296
|
"Invalid argument",
|
|
385
|
-
cmdSysNotFoundStackTrace.stack,
|
|
386
|
-
"The command was not found in the system's PATH or is misspelled",
|
|
387
297
|
503 /* SERVICE_UNAVAILABLE */
|
|
388
298
|
);
|
|
299
|
+
this.logger.error(this.stackTrace.message, "Exited", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
389
300
|
break;
|
|
390
301
|
case 130:
|
|
391
|
-
|
|
302
|
+
this.stackTrace = this.traceError(
|
|
392
303
|
"Indicates that the script was manually terminated by the user using the Control-C (SIGINT) signal",
|
|
393
|
-
"Exited",
|
|
394
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
395
|
-
);
|
|
396
|
-
LogMessageUtils.error(
|
|
397
|
-
"Exited",
|
|
398
304
|
"Script terminated",
|
|
399
|
-
endScriptStackTrace.stack,
|
|
400
|
-
"Indicates that the script was manually terminated by the user using the Control-C (SIGINT) signal",
|
|
401
305
|
503 /* SERVICE_UNAVAILABLE */
|
|
402
306
|
);
|
|
307
|
+
this.logger.error(this.stackTrace.message, "Exited", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
403
308
|
break;
|
|
404
309
|
case 137:
|
|
405
|
-
|
|
310
|
+
this.stackTrace = this.traceError(
|
|
406
311
|
"Indicates that the process was terminated by a SIGKILL signal, possibly due to an out-of-memory situation",
|
|
407
|
-
"Exited",
|
|
408
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
409
|
-
);
|
|
410
|
-
LogMessageUtils.error(
|
|
411
|
-
"Exited",
|
|
412
312
|
"SIGKILL",
|
|
413
|
-
prcKillStackTrace.stack,
|
|
414
|
-
"Indicates that the process was terminated by a SIGKILL signal, possibly due to an out-of-memory situation",
|
|
415
313
|
503 /* SERVICE_UNAVAILABLE */
|
|
416
314
|
);
|
|
315
|
+
this.logger.error(this.stackTrace.message, "Exited", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
417
316
|
break;
|
|
418
317
|
case 139:
|
|
419
|
-
|
|
318
|
+
this.stackTrace = this.traceError(
|
|
420
319
|
"Indicates that the process accessed an illegal memory address (segfault)",
|
|
421
|
-
"Exited",
|
|
422
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
423
|
-
);
|
|
424
|
-
LogMessageUtils.error(
|
|
425
|
-
"Exited",
|
|
426
320
|
"Segmentation fault",
|
|
427
|
-
illegalAccessStackTrace.stack,
|
|
428
|
-
"Indicates that the process accessed an illegal memory address (segfault)",
|
|
429
321
|
503 /* SERVICE_UNAVAILABLE */
|
|
430
322
|
);
|
|
323
|
+
this.logger.error(this.stackTrace.message, "Exited", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
431
324
|
break;
|
|
432
325
|
case 143:
|
|
433
|
-
|
|
326
|
+
this.stackTrace = this.traceError(
|
|
434
327
|
"Indicates that the process received a SIGTERM signal to terminate",
|
|
435
|
-
"Exited",
|
|
436
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
437
|
-
);
|
|
438
|
-
LogMessageUtils.error(
|
|
439
|
-
"Exited",
|
|
440
328
|
"process received a SIGTERM",
|
|
441
|
-
sigtermStackTrace.stack,
|
|
442
|
-
"Indicates that the process received a SIGTERM signal to terminate",
|
|
443
329
|
503 /* SERVICE_UNAVAILABLE */
|
|
444
330
|
);
|
|
331
|
+
this.logger.error(this.stackTrace.message, "Exited", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
445
332
|
break;
|
|
446
333
|
case 255:
|
|
447
|
-
|
|
334
|
+
this.stackTrace = this.traceError(
|
|
448
335
|
"An exit code that is outside the allowable range (0-255 for Unix-like systems)",
|
|
449
|
-
"Exited",
|
|
450
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
451
|
-
);
|
|
452
|
-
LogMessageUtils.error(
|
|
453
|
-
"Exited",
|
|
454
336
|
"out of range",
|
|
455
|
-
outsideStackTrace.stack,
|
|
456
|
-
"An exit code that is outside the allowable range (0-255 for Unix-like systems)",
|
|
457
337
|
503 /* SERVICE_UNAVAILABLE */
|
|
458
338
|
);
|
|
339
|
+
this.logger.error(this.stackTrace.message, "Exited", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
459
340
|
break;
|
|
460
341
|
default:
|
|
461
|
-
|
|
342
|
+
this.stackTrace = this.traceError(
|
|
462
343
|
"Error is occurring",
|
|
463
|
-
"Exited",
|
|
464
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
465
|
-
);
|
|
466
|
-
LogMessageUtils.error(
|
|
467
|
-
"Exited",
|
|
468
344
|
"errors",
|
|
469
|
-
globalStackTrace.stack,
|
|
470
|
-
"Error is occurring",
|
|
471
345
|
503 /* SERVICE_UNAVAILABLE */
|
|
472
346
|
);
|
|
347
|
+
this.logger.error(this.stackTrace.message, "Exited", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
473
348
|
break;
|
|
474
349
|
}
|
|
475
350
|
}
|
|
351
|
+
/**
|
|
352
|
+
*
|
|
353
|
+
* @param promise
|
|
354
|
+
*/
|
|
476
355
|
static promiseRejectionHandled(promise) {
|
|
477
|
-
|
|
356
|
+
this.stackTrace = this.traceError(
|
|
478
357
|
`Promise rejection is handled at : ${promise}`,
|
|
479
358
|
"rejection promise",
|
|
480
359
|
503 /* SERVICE_UNAVAILABLE */
|
|
481
360
|
);
|
|
482
|
-
|
|
483
|
-
"PromiseRejectionHandled",
|
|
484
|
-
"rejection promise",
|
|
485
|
-
globalStackTrace.stack,
|
|
486
|
-
`Promise rejection is handled at : ${promise}`,
|
|
487
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
488
|
-
);
|
|
361
|
+
this.logger.error(this.stackTrace.message, "PromiseRejectionHandled", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
489
362
|
}
|
|
363
|
+
/**
|
|
364
|
+
*
|
|
365
|
+
* @param error
|
|
366
|
+
*/
|
|
490
367
|
static uncaughtException(error) {
|
|
491
368
|
if (error.message === "'app.router' is deprecated!\nPlease see the 3.x to 4.x migration guide for details on how to update your app.") {
|
|
492
369
|
console.log("");
|
|
493
370
|
} else {
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
"uncaught exception handled",
|
|
497
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
498
|
-
);
|
|
499
|
-
LogMessageUtils.error(
|
|
500
|
-
"UncaughtException",
|
|
501
|
-
"uncaught exception handled",
|
|
502
|
-
tackTrace.stack,
|
|
503
|
-
error.message,
|
|
504
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
505
|
-
);
|
|
371
|
+
this.stackTrace = this.traceError(error.message, "uncaught exception handled", 503 /* SERVICE_UNAVAILABLE */);
|
|
372
|
+
this.logger.error(this.stackTrace.message, "UncaughtException", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
506
373
|
}
|
|
507
374
|
}
|
|
375
|
+
/**
|
|
376
|
+
*
|
|
377
|
+
* @param error
|
|
378
|
+
*/
|
|
508
379
|
static uncaughtExceptionMonitor(error) {
|
|
509
380
|
if (error.message === "'app.router' is deprecated!\nPlease see the 3.x to 4.x migration guide for details on how to update your app.") {
|
|
510
381
|
console.log("");
|
|
511
382
|
}
|
|
512
383
|
}
|
|
384
|
+
/**
|
|
385
|
+
*
|
|
386
|
+
* @param reason
|
|
387
|
+
* @param promise
|
|
388
|
+
*/
|
|
513
389
|
static unhandledRejection(reason, promise) {
|
|
514
|
-
|
|
390
|
+
this.stackTrace = this.traceError(
|
|
515
391
|
`Unhandled Rejection at: Promise ${promise} -- reason ${reason}`,
|
|
516
392
|
"Unhandled rejection",
|
|
517
393
|
503 /* SERVICE_UNAVAILABLE */
|
|
518
394
|
);
|
|
519
|
-
|
|
520
|
-
"UnhandledRejection",
|
|
521
|
-
"Unhandled rejection",
|
|
522
|
-
stackTrace.stack,
|
|
523
|
-
`Unhandled Rejection at: Promise ${promise} -- reason ${reason}`,
|
|
524
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
525
|
-
);
|
|
395
|
+
this.logger.error(this.stackTrace.message, "UnhandledRejection", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
526
396
|
}
|
|
397
|
+
/**
|
|
398
|
+
*
|
|
399
|
+
* @param warning
|
|
400
|
+
*/
|
|
527
401
|
static warning(warning) {
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
"Warning",
|
|
531
|
-
"warning",
|
|
532
|
-
stackTrace.stack,
|
|
533
|
-
warning.message,
|
|
534
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
535
|
-
);
|
|
402
|
+
this.stackTrace = this.traceError(warning.message, "warning", 503 /* SERVICE_UNAVAILABLE */);
|
|
403
|
+
this.logger.error(this.stackTrace.message, "Warning", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
536
404
|
}
|
|
405
|
+
/**
|
|
406
|
+
*
|
|
407
|
+
* @param message
|
|
408
|
+
*/
|
|
537
409
|
static message(message) {
|
|
538
|
-
|
|
410
|
+
this.stackTrace = this.traceError(
|
|
539
411
|
`process got message ${message}`,
|
|
540
412
|
"message exception",
|
|
541
413
|
503 /* SERVICE_UNAVAILABLE */
|
|
542
414
|
);
|
|
543
|
-
|
|
544
|
-
"Message",
|
|
545
|
-
"message exception",
|
|
546
|
-
stackTrace.stack,
|
|
547
|
-
`process got message ${message}`,
|
|
548
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
549
|
-
);
|
|
415
|
+
this.logger.error(this.stackTrace.message, "Message", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
550
416
|
}
|
|
417
|
+
/**
|
|
418
|
+
*
|
|
419
|
+
* @param type
|
|
420
|
+
* @param promise
|
|
421
|
+
* @param reason
|
|
422
|
+
*/
|
|
551
423
|
static multipleResolves(type, promise, reason) {
|
|
552
|
-
|
|
424
|
+
this.stackTrace = this.traceError(
|
|
553
425
|
`${promise} -- ${reason}`,
|
|
554
|
-
"multipleResolves",
|
|
555
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
556
|
-
);
|
|
557
|
-
LogMessageUtils.error(
|
|
558
|
-
"multipleResolves",
|
|
559
426
|
`Multiple resolves detected : ${type}`,
|
|
560
|
-
stackTrace.stack,
|
|
561
|
-
`${promise} -- ${reason}`,
|
|
562
427
|
503 /* SERVICE_UNAVAILABLE */
|
|
563
428
|
);
|
|
429
|
+
this.logger.error(this.stackTrace.message, "multipleResolves", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
564
430
|
}
|
|
431
|
+
/**
|
|
432
|
+
*
|
|
433
|
+
*/
|
|
565
434
|
static processInterrupted() {
|
|
566
|
-
|
|
567
|
-
"[ OK ] Success",
|
|
568
|
-
`Process ${process.pid} has been interrupted`,
|
|
569
|
-
"The Web server has been stopped !"
|
|
570
|
-
);
|
|
435
|
+
this.logger.success("[ OK ] Success", "The Web server has been stopped !");
|
|
571
436
|
process.exit(0);
|
|
572
437
|
}
|
|
438
|
+
/**
|
|
439
|
+
*
|
|
440
|
+
* @param signal
|
|
441
|
+
*/
|
|
573
442
|
static sigtermSignalReceived(signal) {
|
|
574
|
-
|
|
575
|
-
`Process ${process.pid} received a SIGTERM signal`,
|
|
576
|
-
"SIGTERM",
|
|
577
|
-
406 /* NOT_ACCEPTABLE */
|
|
578
|
-
);
|
|
579
|
-
LogMessageUtils.error(
|
|
580
|
-
"SIGTERM",
|
|
581
|
-
"SIGTERM",
|
|
582
|
-
stackTrace.stack,
|
|
443
|
+
this.stackTrace = this.traceError(
|
|
583
444
|
`Process ${process.pid} received a SIGTERM signal : ${signal.toString()}`,
|
|
445
|
+
"SIGTERM",
|
|
584
446
|
406 /* NOT_ACCEPTABLE */
|
|
585
447
|
);
|
|
448
|
+
this.logger.error(this.stackTrace.message, "SIGTERM", this.stackTrace.name, this.stackTrace.stack, 406 /* NOT_ACCEPTABLE */);
|
|
586
449
|
process.exit(0);
|
|
587
450
|
}
|
|
451
|
+
/**
|
|
452
|
+
*
|
|
453
|
+
*/
|
|
588
454
|
static serverClosing() {
|
|
589
|
-
console.log(`${
|
|
455
|
+
console.log(`${colors2.bgCyanBright(` ${colors2.bold(`${colors2.white(` INFO `)}`)}`)} All processes are stopped`);
|
|
590
456
|
console.log(" Server is closed");
|
|
591
457
|
process.exit();
|
|
592
458
|
}
|
|
459
|
+
/**
|
|
460
|
+
*
|
|
461
|
+
*/
|
|
593
462
|
static dropNewConnection() {
|
|
594
|
-
console.log(`${
|
|
463
|
+
console.log(`${colors2.cyan(`\u24D8`)} ${colors2.bgCyan(` ${colors2.bold(`${colors2.white(` Server maxConnection `)}`)} `)} ${dateTimeFormattedUtils} | ${colors2.bgCyan(`${colors2.white(` Info `)}`)} The server dropped new connections`);
|
|
595
464
|
}
|
|
465
|
+
/**
|
|
466
|
+
*
|
|
467
|
+
* @param errorEmitter
|
|
468
|
+
* @param err
|
|
469
|
+
* @param req
|
|
470
|
+
* @param res
|
|
471
|
+
* @param next
|
|
472
|
+
*/
|
|
596
473
|
static expressErrorHandlingMiddleware(errorEmitter, err, req, res, next) {
|
|
597
474
|
if (err) {
|
|
598
475
|
errorEmitter.emit(CEventNameError.error, err);
|
|
@@ -601,14 +478,8 @@ var ServerListenEventError = class {
|
|
|
601
478
|
} else {
|
|
602
479
|
console.error("res.status is not a function");
|
|
603
480
|
}
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
"Express error-handling middleware",
|
|
607
|
-
"Express error",
|
|
608
|
-
stackTrace.stack,
|
|
609
|
-
err.message,
|
|
610
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
611
|
-
);
|
|
481
|
+
this.stackTrace = this.traceError(err.message, "Express error", 406 /* NOT_ACCEPTABLE */);
|
|
482
|
+
this.logger.error(this.stackTrace.message, "Express error-handling middleware", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
612
483
|
} else {
|
|
613
484
|
next();
|
|
614
485
|
}
|
|
@@ -617,6 +488,7 @@ var ServerListenEventError = class {
|
|
|
617
488
|
return new StackTraceError(props, name, status, true);
|
|
618
489
|
}
|
|
619
490
|
};
|
|
491
|
+
ServerListenEventError.logger = new LoggerCore();
|
|
620
492
|
|
|
621
493
|
// src/core/handlers/eventProcess.handler.ts
|
|
622
494
|
function eventProcessHandler() {
|
|
@@ -669,83 +541,80 @@ function eventProcessHandler() {
|
|
|
669
541
|
}
|
|
670
542
|
|
|
671
543
|
// src/core/events/requestCalls.event.ts
|
|
672
|
-
import
|
|
673
|
-
import { LoggerCore } from "opticore-logger";
|
|
544
|
+
import colors3 from "ansi-colors";
|
|
545
|
+
import { LoggerCore as LoggerCore2 } from "opticore-logger";
|
|
674
546
|
function requestCallsEvent(req, res, host, port, loadingTime) {
|
|
675
|
-
const logger = new
|
|
547
|
+
const logger = new LoggerCore2();
|
|
676
548
|
const currentDatePath = `Request called`;
|
|
677
549
|
if (req.originalUrl === "undefined") {
|
|
678
|
-
console.log(`[ ${
|
|
550
|
+
console.log(`[ ${colors3.red(`${currentDatePath}`)} ] ${loadingTime} | ${colors3.bgRed(`${colors3.white(` Not found `)}`)} [ Host ] http://${host}:${port} - [ Route ] The route do not exist. - [ Status ] ${colors3.red(`${colors3.white(` 404 `)}`)}`);
|
|
679
551
|
logger.error("The route do not exist.");
|
|
680
552
|
} else {
|
|
681
553
|
switch (res.statusCode) {
|
|
682
554
|
case 200:
|
|
683
555
|
switch (req.method) {
|
|
684
556
|
case "POST":
|
|
685
|
-
|
|
686
|
-
logger.info(`[ ${colors4.cyan(`${currentDatePath}`)} ] ${loadingTime} | ${colors4.bgGreen(`${colors4.white(` Success `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ Status ] ${colors4.bgCyan(`${colors4.white(` 200 `)}`)}`);
|
|
557
|
+
logger.info(`[ ${colors3.cyan(`${currentDatePath}`)} ] ${loadingTime} | ${colors3.bgGreen(`${colors3.white(` Success `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ Status ] ${colors3.bgCyan(`${colors3.white(` 200 `)}`)}`);
|
|
687
558
|
break;
|
|
688
559
|
case "GET":
|
|
689
560
|
case "PUT":
|
|
690
|
-
|
|
691
|
-
logger.info(`[ ${colors4.cyan(`${currentDatePath}`)} ] ${loadingTime} | ${colors4.bgGreen(`${colors4.white(` Success `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${colors4.bgCyan(`${colors4.white(` 200 `)}`)}`);
|
|
561
|
+
logger.info(`[ ${colors3.cyan(`${currentDatePath}`)} ] ${loadingTime} | ${colors3.bgGreen(`${colors3.white(` Success `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${colors3.bgCyan(`${colors3.white(` 200 `)}`)}`);
|
|
692
562
|
break;
|
|
693
563
|
case "DELETE":
|
|
694
|
-
|
|
695
|
-
logger.info(`[ ${colors4.cyan(`${currentDatePath}`)} ] ${loadingTime} | ${colors4.bgGreen(`${colors4.white(` Success `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${colors4.bgCyan(`${colors4.white(` 200 `)}`)}`);
|
|
564
|
+
logger.info(`[ ${colors3.cyan(`${currentDatePath}`)} ] ${loadingTime} | ${colors3.bgGreen(`${colors3.white(` Success `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${colors3.bgCyan(`${colors3.white(` 200 `)}`)}`);
|
|
696
565
|
break;
|
|
697
566
|
}
|
|
698
567
|
break;
|
|
699
568
|
case 404:
|
|
700
569
|
switch (req.method) {
|
|
701
570
|
case "POST":
|
|
702
|
-
console.log(`[ ${
|
|
571
|
+
console.log(`[ ${colors3.red(`${currentDatePath}`)} ] ${loadingTime} | ${colors3.bgRed(`${colors3.white(` Not found `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ Status ] ${colors3.red(`${colors3.white(` 404 `)}`)}`);
|
|
703
572
|
break;
|
|
704
573
|
case "GET":
|
|
705
|
-
console.log(`[ ${
|
|
574
|
+
console.log(`[ ${colors3.red(`${currentDatePath}`)} ] ${loadingTime} | ${colors3.bgRed(`${colors3.white(` Not found `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${colors3.red(`${colors3.bold(` 404 `)}`)}`);
|
|
706
575
|
break;
|
|
707
576
|
case "PUT":
|
|
708
|
-
console.log(`[ ${
|
|
577
|
+
console.log(`[ ${colors3.red(`${currentDatePath}`)} ] ${loadingTime} | ${colors3.bgRed(`${colors3.white(` Not found `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${colors3.red(`${colors3.bold(` 404 `)}`)}`);
|
|
709
578
|
break;
|
|
710
579
|
case "DELETE":
|
|
711
|
-
console.log(`[ ${
|
|
580
|
+
console.log(`[ ${colors3.red(`${currentDatePath}`)} ] ${loadingTime} | ${colors3.bgRed(`${colors3.white(` Not found `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${colors3.red(`${colors3.bold(` 404 `)}`)}`);
|
|
712
581
|
break;
|
|
713
582
|
}
|
|
714
583
|
break;
|
|
715
584
|
case 401:
|
|
716
585
|
switch (req.method) {
|
|
717
586
|
case "POST":
|
|
718
|
-
console.log(`[ ${
|
|
587
|
+
console.log(`[ ${colors3.yellowBright(`${currentDatePath}`)} ] ${loadingTime} | ${colors3.bgYellowBright(`${colors3.white(` Unauthorized `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ Status ] ${colors3.bgYellow(`${colors3.bold(` 401 `)}`)}`);
|
|
719
588
|
break;
|
|
720
589
|
case "GET":
|
|
721
|
-
console.log(`[ ${
|
|
590
|
+
console.log(`[ ${colors3.yellowBright(`${currentDatePath}`)} ] ${loadingTime} | ${colors3.bgYellowBright(`${colors3.white(` Unauthorized `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ Status ] ${colors3.bgYellow(`${colors3.bold(` 401 `)}`)}`);
|
|
722
591
|
break;
|
|
723
592
|
case "PUT":
|
|
724
|
-
console.log(`[ ${
|
|
593
|
+
console.log(`[ ${colors3.yellowBright(`${currentDatePath}`)} ] ${loadingTime} | ${colors3.bgYellowBright(`${colors3.white(` Unauthorized `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ Status ] ${colors3.bgYellow(`${colors3.bold(` 401 `)}`)}`);
|
|
725
594
|
break;
|
|
726
595
|
case "DELETE":
|
|
727
|
-
console.log(`[ ${
|
|
596
|
+
console.log(`[ ${colors3.yellowBright(`${currentDatePath}`)} ] ${loadingTime} | ${colors3.bgYellowBright(`${colors3.white(` Unauthorized `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ Status ] ${colors3.bgYellow(`${colors3.bold(` 401 `)}`)}`);
|
|
728
597
|
break;
|
|
729
598
|
}
|
|
730
599
|
break;
|
|
731
600
|
case 500:
|
|
732
601
|
switch (req.method) {
|
|
733
602
|
case "POST":
|
|
734
|
-
console.log(`[ ${
|
|
603
|
+
console.log(`[ ${colors3.red(`${currentDatePath}`)} ] ${loadingTime} | ${colors3.bgRed(`${colors3.white(` Server error `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ Status ] ${colors3.red(`${colors3.bold(` 500 `)}`)}`);
|
|
735
604
|
break;
|
|
736
605
|
case "GET":
|
|
737
|
-
console.log(`[ ${
|
|
606
|
+
console.log(`[ ${colors3.red(`${currentDatePath}`)} ] ${loadingTime} | ${colors3.bgRed(`${colors3.white(` Server error `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${colors3.red(`${colors3.bold(` 500 `)}`)}`);
|
|
738
607
|
break;
|
|
739
608
|
case "PUT":
|
|
740
|
-
console.log(`[ ${
|
|
609
|
+
console.log(`[ ${colors3.red(`${currentDatePath}`)} ] ${loadingTime} | ${colors3.bgRed(`${colors3.white(` Server error `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${colors3.red(`${colors3.bold(` 500 `)}`)}`);
|
|
741
610
|
break;
|
|
742
611
|
case "DELETE":
|
|
743
|
-
console.log(`[ ${
|
|
612
|
+
console.log(`[ ${colors3.red(`${currentDatePath}`)} ] ${loadingTime} | ${colors3.bgRed(`${colors3.white(` Server error `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${colors3.red(`${colors3.bold(` 500 `)}`)}`);
|
|
744
613
|
break;
|
|
745
614
|
}
|
|
746
615
|
break;
|
|
747
616
|
default:
|
|
748
|
-
console.log(`[ ${
|
|
617
|
+
console.log(`[ ${colors3.blueBright(`${currentDatePath}`)} ] ${loadingTime} | ${colors3.blueBright(` ${res.statusMessage} `)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ Status ] ${colors3.blueBright(` ${res.req.socket._httpMessage.statusCode} `)}`);
|
|
749
618
|
break;
|
|
750
619
|
}
|
|
751
620
|
}
|
|
@@ -760,6 +629,28 @@ import colors6 from "ansi-colors";
|
|
|
760
629
|
|
|
761
630
|
// src/core/utils/modulesLoaded.utils.ts
|
|
762
631
|
import colors5 from "ansi-colors";
|
|
632
|
+
|
|
633
|
+
// src/core/utils/logMessage.utils.ts
|
|
634
|
+
import colors4 from "ansi-colors";
|
|
635
|
+
var LogMessageUtils = class {
|
|
636
|
+
static success(title, action, contentAction) {
|
|
637
|
+
console.log(`${colors4.green(`\u2714`)} ${colors4.bgGreen(` ${colors4.bold(`${colors4.white(`${title}`)}`)} `)} ${dateTimeFormattedUtils} | ${colors4.bgGreen(`${colors4.white(` Success `)}`)} [ ${action} ] ${contentAction} - [ Status ] ${colors4.bgGreen(`${colors4.white(` 200 `)}`)}`);
|
|
638
|
+
}
|
|
639
|
+
static warning(title, action, contentAction) {
|
|
640
|
+
console.warn(`${colors4.yellow(`\u26A0\uFE0F`)} ${colors4.bgYellow(` ${colors4.bold(`${colors4.white(`${title}`)}`)} `)} ${dateTimeFormattedUtils} | ${colors4.bgYellow(`${colors4.white(` Warning `)}`)} ${contentAction}`);
|
|
641
|
+
}
|
|
642
|
+
static info(title, action, contentAction) {
|
|
643
|
+
console.info(`${colors4.cyan(`\u24D8`)} ${colors4.bgCyan(` ${colors4.bold(`${colors4.white(`${title}`)}`)} `)} ${dateTimeFormattedUtils} | ${colors4.bgCyan(`${colors4.white(` Info `)}`)} ${contentAction}`);
|
|
644
|
+
}
|
|
645
|
+
static error(title, errorType, stackTrace, messageContent, httpCodeValue) {
|
|
646
|
+
console.error(`${colors4.red(`\u2718`)} ${colors4.bgRed(` ${colors4.bold(`${colors4.white(`${title}`)}`)} `)} | ${dateTimeFormattedUtils} | [ ${colors4.red(`${colors4.bold(` ${errorType} `)}`)} ] | [ ${colors4.bold(`stack trace`)} ] ${colors4.red(`${stackTrace}`)} - ${colors4.red(`${messageContent}`)} - [ ${colors4.red(`${colors4.bold(` HttpCode `)}`)} ] ${colors4.red(`${colors4.bold(` ${httpCodeValue} `)}`)} `);
|
|
647
|
+
}
|
|
648
|
+
static requestError(title, errorName, errorMessage, errorCode) {
|
|
649
|
+
console.error(`[ ${colors4.red(`${title}`)} ] ${dateTimeFormattedUtils} | ${colors4.bgRed(`${colors4.white(` ERROR `)}`)} ${colors4.red(`[ ${errorName} ]`)} ${colors4.red(`${errorMessage}`)} - [ Status ] ${colors4.bgRed(`${colors4.white(` ${errorCode} `)}`)}`);
|
|
650
|
+
}
|
|
651
|
+
};
|
|
652
|
+
|
|
653
|
+
// src/core/utils/modulesLoaded.utils.ts
|
|
763
654
|
function modulesLoadedUtils(allAppRoutes, dbConChecker) {
|
|
764
655
|
LogMessageUtils.success("Kernel", "load kernel", "Modules app have been successfully loaded");
|
|
765
656
|
console.log(`${colors5.whiteBright(` content`)} ${colors5.green("Kernel :")} ${colors5.cyan(`${colors5.bold(`server side`)}`)} has been loaded successfully ${colors5.green(`\u2714`)}`);
|