Update index.js
This commit is contained in:
parent
9bb4b1e9f9
commit
d3bf548a7a
1 changed files with 7 additions and 5 deletions
12
index.js
12
index.js
|
@ -1,7 +1,7 @@
|
||||||
const { writeFile, readFile, mkdir } = require('node:fs/promises');
|
const { writeFile, readFile, mkdir } = require('node:fs/promises');
|
||||||
const { stdin, stdout } = require('node:process');
|
const { stdin, stdout } = require('node:process');
|
||||||
var readlineSync = require('readline-sync');
|
var readlineSync = require('readline-sync');
|
||||||
var name;
|
var name, debug, logs1;
|
||||||
|
|
||||||
function getTime () {
|
function getTime () {
|
||||||
const date_time = new Date();
|
const date_time = new Date();
|
||||||
|
@ -47,17 +47,19 @@ function cin (question, hide) {
|
||||||
|
|
||||||
class createCout {
|
class createCout {
|
||||||
constructor (debugLevel, logs) {
|
constructor (debugLevel, logs) {
|
||||||
this.debug = debugLevel;
|
debug = debugLevel;
|
||||||
this.logs = logs;
|
logs1 = logs;
|
||||||
|
console.log(debug, logs1)
|
||||||
}
|
}
|
||||||
|
|
||||||
cout (string, debugLevel) {
|
cout (string, debugLevel) {
|
||||||
|
console.log(debug, logs1)
|
||||||
if (!debugLevel) debugLevel = 0;
|
if (!debugLevel) debugLevel = 0;
|
||||||
var time = getTime();
|
var time = getTime();
|
||||||
|
|
||||||
if (this.debug >= debugLevel) {
|
if (debug >= debugLevel) {
|
||||||
console.log(`[${time.year}.${time.month}.${time.day}-${time.hours}:${time.minutes}:${time.seconds}] | ${String(string)}`);
|
console.log(`[${time.year}.${time.month}.${time.day}-${time.hours}:${time.minutes}:${time.seconds}] | ${String(string)}`);
|
||||||
if (this.logs) {
|
if (logs1) {
|
||||||
log(string);
|
log(string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue