Skip to content

Commit 412dc57

Browse files
authored
Merge pull request #76 from ngfelixl/feat/console-log-scopes
feat: add scope to console logs
2 parents 21c2083 + b45cfd3 commit 412dc57

File tree

6 files changed

+13
-10
lines changed

6 files changed

+13
-10
lines changed

apps/web/src/app/services/socket.service.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ export class SocketService implements OnDestroy {
1010
this.socket = io(environment.socketIoEndpoint, { transports: ['polling'] });
1111

1212
this.socket.on('connect', () => {
13-
console.log('connected');
13+
console.log('[Nodeplotlib] connected');
1414
});
1515

1616
this.socket.on('disconnect', () => {
17-
console.log('disconnected');
17+
console.log('[Nodeplotlib] disconnected');
1818
});
1919
}
2020

libs/nodeplotlib/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nodeplotlib",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"description": "NodeJS frontend-less plotting lib using plotly.js inspired by matplotlib",
55
"author": "Felix Lemke <[email protected]> (https://felixlemke.dev)",
66
"license": "MIT",

libs/nodeplotlib/src/lib/nodeplotlib.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export function plot(
4545

4646
async function bootstrap(port: number) {
4747
if (appRuns) {
48-
console.log('App is already up and running');
48+
console.log('[Nodeplotlib] App is already up and running');
4949
return;
5050
}
5151
appRuns = true;
@@ -57,13 +57,16 @@ async function bootstrap(port: number) {
5757
const actualPort = app.getHttpServer().address().port;
5858
bridgeService.setPort(actualPort);
5959
plotsService.setBuffer(plotsBuffer$);
60-
console.log('Server running at', `http://localhost:${actualPort}`);
60+
console.log(
61+
'[Nodeplotlib] Server running at',
62+
`http://localhost:${actualPort}`
63+
);
6164

6265
shutdownSubscription = bridgeService.shutdown$.subscribe(shutdown);
6366
}
6467

6568
async function shutdown() {
66-
console.log('Server shutting down');
69+
console.log('[Nodeplotlib] Server shutting down');
6770
shutdownSubscription?.unsubscribe();
6871
appRuns = false;
6972

libs/nodeplotlib/src/lib/server/plots/plots.gateway.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ export class PlotsGateway implements OnGatewayConnection, OnGatewayDisconnect {
5656
}
5757

5858
handleConnection(client: WebSocket) {
59-
console.log('client connected');
59+
console.log('[Nodeplotlib] client connected');
6060
this.clientMap.set(client, Date.now());
6161
}
6262

6363
handleDisconnect(client: WebSocket) {
64-
console.log('client disconnected');
64+
console.log('[Nodeplotlib] client disconnected');
6565
this.clientMap.delete(client);
6666

6767
if (this.clientMap.size === 0) {

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nodeplotlib",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"license": "MIT",
55
"scripts": {
66
"ng": "nx",

0 commit comments

Comments
 (0)