mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-02-17 23:45:29 -05:00
use standard \033 escape sequence for vt esc codes
This commit is contained in:
parent
6e71913c46
commit
08d1011433
1 changed files with 7 additions and 7 deletions
|
@ -101,10 +101,10 @@ function pad(str) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var subsystems = [{
|
var subsystems = [{
|
||||||
in: '\x1b[32m<--\x1b[39m',
|
in: '\033[32m<--\033[39m',
|
||||||
out: '\x1b[33m-->\x1b[39m',
|
out: '\033[33m-->\033[39m',
|
||||||
fs: '\x1b[90m-=-\x1b[39m',
|
fs: '\033[90m-=-\033[39m',
|
||||||
default: '\x1b[34m---\x1b[39m',
|
default: '\033[34m---\033[39m',
|
||||||
}, {
|
}, {
|
||||||
in: '<--',
|
in: '<--',
|
||||||
out: '-->',
|
out: '-->',
|
||||||
|
@ -135,9 +135,9 @@ function print(type, msg, obj, colors) {
|
||||||
if (!colors) {
|
if (!colors) {
|
||||||
return str
|
return str
|
||||||
} else if (is_error) {
|
} else if (is_error) {
|
||||||
return '\x1b[31m' + str + '\x1b[39m'
|
return '\033[31m' + str + '\033[39m'
|
||||||
} else {
|
} else {
|
||||||
return '\x1b[32m' + str + '\x1b[39m'
|
return '\033[32m' + str + '\033[39m'
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return require('util').inspect(str, void 0, void 0, colors)
|
return require('util').inspect(str, void 0, void 0, colors)
|
||||||
|
@ -147,7 +147,7 @@ function print(type, msg, obj, colors) {
|
||||||
// ^^--- black magic... kidding, just "colors ? 0 : 1"
|
// ^^--- black magic... kidding, just "colors ? 0 : 1"
|
||||||
|
|
||||||
if (colors) {
|
if (colors) {
|
||||||
return " \x1b[" + levels[type] + "m" + (pad(type)) + "\x1b[39m " + sub + " " + finalmsg
|
return " \033[" + levels[type] + "m" + (pad(type)) + "\033[39m " + sub + " " + finalmsg
|
||||||
} else {
|
} else {
|
||||||
return " " + (pad(type)) + " " + sub + " " + finalmsg
|
return " " + (pad(type)) + " " + sub + " " + finalmsg
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue