Skip to content
Permalink
Browse files

docs(web-multi-logger): add doc comments for js API site

  • Loading branch information
MarshallOfSound committed May 15, 2018
1 parent 70801f6 commit a79931f85af1dcc1f460e06b9c5317938055d585
Showing with 13 additions and 0 deletions.
  1. +10 −0 packages/utils/web-multi-logger/src/Logger.ts
  2. +3 −0 packages/utils/web-multi-logger/src/Tab.ts
@@ -26,18 +26,28 @@ export default class Logger {
(this.app as any).ws('/sub', () => {});
}

/**
* Creates a new tab with the given name, the name should be human readable
* it will be used as the tab title in the front end.
*/
createTab(name: string) {
const tab = new Tab(name, this.ws);
this.tabs.push(tab);
return tab;
}

/**
* Start the HTTP server hosting the web UI
*/
start() {
return new Promise<number>((resolve) => {
this.server = this.app.listen(this.port, () => resolve(this.port));
});
}

/**
* Stop the HTTP server hosting the web UI
*/
stop() {
if (this.server) this.server.close();
}
@@ -13,6 +13,9 @@ export default class Tab {
idCounter += 1;
}

/**
* Log a line to the web UI, a new line is automatically appended to the line
*/
log(line: string) {
const log = new Log(line, new Date());
this.logs.push(log);

0 comments on commit a79931f

Please sign in to comment.
You can’t perform that action at this time.