mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
Merge pull request #3556 from N-Nagorny/logs-smart-app-name-cutting
logs: Make padding mechanism working only if padding is longer than string
This commit is contained in:
commit
bfddf4fdef
@ -291,6 +291,10 @@ function pad(pad, str, padLeft) {
|
||||
if (padLeft) {
|
||||
return (pad + str).slice(-pad.length);
|
||||
} else {
|
||||
return (str + pad).substring(0, pad.length);
|
||||
if (pad.length > str.length) {
|
||||
return (str + pad).substring(0, pad.length);
|
||||
} else {
|
||||
return str;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user