Skip to content

Commit 90e98bb

Browse files
committed
fix: Remove terminal colors, closes #28
1 parent 32b1460 commit 90e98bb

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
"test": "yarn lint && yarn build && yarn test-only"
4242
},
4343
"dependencies": {
44-
"chalk": "^4.1.0",
4544
"cloneable-readable": "^2.0.1",
4645
"merge-stream": "^2.0.0",
4746
"npm-run-path": "^4.0.1",

src/core/CompositeService.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { formatWithOptions } from 'util'
2-
import { Service } from './Service'
32
import mergeStream from 'merge-stream'
4-
import chalk from 'chalk'
3+
import { Service } from './Service'
54
import {
65
NormalizedCompositeServiceConfig,
76
validateAndNormalizeConfig,
@@ -55,11 +54,9 @@ export class CompositeService {
5554
)
5655

5756
outputStream.add(
58-
this.services.map(({ output, id }, i) => {
59-
// luminosity of 20 because at 256 colors, luminosity from 16 to 24 yields the most colors (12 colors) while keeping high contrast with text
60-
const label = chalk.bgHsl((i / this.services.length) * 360, 100, 20)(id)
61-
return output.pipe(mapStreamLines(line => `${label} | ${line}`))
62-
}),
57+
this.services.map(({ output, id }) =>
58+
output.pipe(mapStreamLines(line => `${id} | ${line}`)),
59+
),
6360
)
6461

6562
this.logger.log('debug', 'Starting composite service...')

src/core/Logger.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import { PassThrough } from 'stream'
2-
import chalk from 'chalk'
32

43
export type LogLevel = 'debug' | 'info' | 'error'
54

65
const orderedLogLevels: LogLevel[] = ['error', 'info', 'debug']
7-
const logLevelColors = { error: 'red', info: 'teal', debug: 'yellow' }
86

97
export class Logger {
108
private level: LogLevel
@@ -14,9 +12,8 @@ export class Logger {
1412
}
1513
public log(level: LogLevel, text: string) {
1614
if (this.shouldLog(level)) {
17-
const label = chalk.keyword(logLevelColors[level])(`(${level})`)
1815
for (const line of text.split('\n')) {
19-
this.output.write(` ${label} ${line}\n`)
16+
this.output.write(` (${level}) ${line}\n`)
2017
}
2118
}
2219
}

0 commit comments

Comments
 (0)