Skip to content

feat: add scope to console logs #76

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/web/src/app/services/socket.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ export class SocketService implements OnDestroy {
this.socket = io(environment.socketIoEndpoint, { transports: ['polling'] });

this.socket.on('connect', () => {
console.log('connected');
console.log('[Nodeplotlib] connected');
});

this.socket.on('disconnect', () => {
console.log('disconnected');
console.log('[Nodeplotlib] disconnected');
});
}

Expand Down
2 changes: 1 addition & 1 deletion libs/nodeplotlib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nodeplotlib",
"version": "1.1.1",
"version": "1.1.2",
"description": "NodeJS frontend-less plotting lib using plotly.js inspired by matplotlib",
"author": "Felix Lemke <[email protected]> (https://felixlemke.dev)",
"license": "MIT",
Expand Down
9 changes: 6 additions & 3 deletions libs/nodeplotlib/src/lib/nodeplotlib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function plot(

async function bootstrap(port: number) {
if (appRuns) {
console.log('App is already up and running');
console.log('[Nodeplotlib] App is already up and running');
return;
}
appRuns = true;
Expand All @@ -57,13 +57,16 @@ async function bootstrap(port: number) {
const actualPort = app.getHttpServer().address().port;
bridgeService.setPort(actualPort);
plotsService.setBuffer(plotsBuffer$);
console.log('Server running at', `http://localhost:${actualPort}`);
console.log(
'[Nodeplotlib] Server running at',
`http://localhost:${actualPort}`
);

shutdownSubscription = bridgeService.shutdown$.subscribe(shutdown);
}

async function shutdown() {
console.log('Server shutting down');
console.log('[Nodeplotlib] Server shutting down');
shutdownSubscription?.unsubscribe();
appRuns = false;

Expand Down
4 changes: 2 additions & 2 deletions libs/nodeplotlib/src/lib/server/plots/plots.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ export class PlotsGateway implements OnGatewayConnection, OnGatewayDisconnect {
}

handleConnection(client: WebSocket) {
console.log('client connected');
console.log('[Nodeplotlib] client connected');
this.clientMap.set(client, Date.now());
}

handleDisconnect(client: WebSocket) {
console.log('client disconnected');
console.log('[Nodeplotlib] client disconnected');
this.clientMap.delete(client);

if (this.clientMap.size === 0) {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nodeplotlib",
"version": "1.1.1",
"version": "1.1.2",
"license": "MIT",
"scripts": {
"ng": "nx",
Expand Down