mirror of
https://github.com/danbulant/sql2csv
synced 2026-06-17 13:31:27 +00:00
Colors option
This commit is contained in:
parent
b57793b58a
commit
1fa2ba1fc4
1 changed files with 11 additions and 5 deletions
14
sql2csv.js
14
sql2csv.js
|
|
@ -3,14 +3,20 @@ const { execSync } = require('child_process');
|
||||||
class sql2csv {
|
class sql2csv {
|
||||||
log(str){
|
log(str){
|
||||||
if(!this.options.logging) return;
|
if(!this.options.logging) return;
|
||||||
if(this.options.colors)
|
if(this.options.colors){
|
||||||
console.log(this.options.prefix + str + "\x1b[0m");
|
console.log(this.options.prefix + str + "\x1b[0m");
|
||||||
console.log(this.options.prefix + str + "\x1b[0m");
|
} else {
|
||||||
|
console.log(this.options.prefix + str);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
warn(str){
|
warn(str){
|
||||||
if(!this.options.logging) return;
|
if(!this.options.logging) return;
|
||||||
console.warn(this.options.prefix + "\x1b[33m" + str + "\x1b[0m");
|
if(this.options.colors){
|
||||||
|
console.warn(this.options.prefix + "\x1b[33m" + str + "\x1b[0m");
|
||||||
|
} else {
|
||||||
|
console.warn(this.options.prefix + str);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue