klaudiosinani / signale

Highly configurable logging utility
MIT License
8.93k stars 232 forks source link

Split and align on linebreaks and too long lines #94

Open vorph1 opened 5 years ago

vorph1 commented 5 years ago

Hi! I wanted a more readable output for longer messages so I went ahead and implemented that. Here's a sample output and corresponding code


signale.config({
    splitLongLines: true, //split to 80 chars width
    splitLinebreaks: true
});

signale.complete({prefix: '[task]', message: 'Fix issue #59 '.repeat(20), suffix: '(@klauscfhq)'});

signale.config({
    splitLongLines: 120, // split to given width
    splitLinebreaks: true
});

signale.complete({prefix: '[task]', message: 'Fix issue #59 '.repeat(20), suffix: '(@klauscfhq)'});

signale.config({
    splitLongLines: 'auto', // split to terminal width
    splitLinebreaks: true
});

signale.complete({prefix: '[task]', message: 'Fix issue #59 '.repeat(20), suffix: '(@klauscfhq)'});

signale.config({
    splitLongLines: 'auto', // split to terminal width
    splitLinebreaks: true
});

signale.complete({prefix: '[task]', message: "Fix issue #59\n".repeat(20), suffix: '(@klauscfhq)'});

1560872094

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information