mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-04-13 06:02:57 +00:00
log: Add livepush logging functions
Change-type: minor Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
parent
4cfaf6e666
commit
cf2ad66955
@ -28,6 +28,7 @@ class Logger {
|
||||
warn: NodeJS.ReadWriteStream;
|
||||
error: NodeJS.ReadWriteStream;
|
||||
logs: NodeJS.ReadWriteStream;
|
||||
livepush: NodeJS.ReadWriteStream;
|
||||
};
|
||||
|
||||
public formatMessage: (name: string, message: string) => string;
|
||||
@ -41,6 +42,7 @@ class Logger {
|
||||
logger.addPrefix('warn', chalk.yellow('[Warn]'));
|
||||
logger.addPrefix('error', chalk.red('[Error]'));
|
||||
logger.addPrefix('logs', chalk.green('[Logs]'));
|
||||
logger.addPrefix('live', chalk.yellow('[Live]'));
|
||||
|
||||
this.streams = {
|
||||
build: logger.createLogStream('build'),
|
||||
@ -50,6 +52,7 @@ class Logger {
|
||||
warn: logger.createLogStream('warn'),
|
||||
error: logger.createLogStream('error'),
|
||||
logs: logger.createLogStream('logs'),
|
||||
livepush: logger.createLogStream('live'),
|
||||
};
|
||||
|
||||
_.forEach(this.streams, function(stream, key) {
|
||||
@ -88,6 +91,10 @@ class Logger {
|
||||
public logLogs(msg: string) {
|
||||
return this.streams.logs.write(msg + eol);
|
||||
}
|
||||
|
||||
logLivepush(msg: string) {
|
||||
return this.streams.livepush.write(msg + eol);
|
||||
}
|
||||
}
|
||||
|
||||
export = Logger;
|
||||
|
Loading…
x
Reference in New Issue
Block a user