Skip to content

Commit 6a4125d

Browse files
authored
Merge pull request tlaverdure#543 from JoeMc98/master
use toISOString() to output with date
2 parents bd4d6f7 + 94d3f68 commit 6a4125d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/channels/channel.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export class Channel {
8282
socket.leave(channel);
8383

8484
if (this.options.devMode) {
85-
Log.info(`[${new Date().toLocaleTimeString()}] - ${socket.id} left channel: ${channel} (${reason})`);
85+
Log.info(`[${new Date().toISOString()}] - ${socket.id} left channel: ${channel} (${reason})`);
8686
}
8787
}
8888
}
@@ -140,7 +140,7 @@ export class Channel {
140140
*/
141141
onJoin(socket: any, channel: string): void {
142142
if (this.options.devMode) {
143-
Log.info(`[${new Date().toLocaleTimeString()}] - ${socket.id} joined channel: ${channel}`);
143+
Log.info(`[${new Date().toISOString()}] - ${socket.id} joined channel: ${channel}`);
144144
}
145145
}
146146

src/channels/private-channel.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class PrivateChannel {
2828
};
2929

3030
if (this.options.devMode) {
31-
Log.info(`[${new Date().toLocaleTimeString()}] - Sending auth request to: ${options.url}\n`);
31+
Log.info(`[${new Date().toISOString()}] - Sending auth request to: ${options.url}\n`);
3232
}
3333

3434
return this.serverRequest(socket, options);
@@ -61,7 +61,7 @@ export class PrivateChannel {
6161
}
6262

6363
if (this.options.devMode) {
64-
Log.error(`[${new Date().toLocaleTimeString()}] - Preparing authentication request to: ${authHostSelected}`);
64+
Log.error(`[${new Date().toISOString()}] - Preparing authentication request to: ${authHostSelected}`);
6565
}
6666

6767
return authHostSelected;
@@ -87,21 +87,21 @@ export class PrivateChannel {
8787
this.request.post(options, (error, response, body, next) => {
8888
if (error) {
8989
if (this.options.devMode) {
90-
Log.error(`[${new Date().toLocaleTimeString()}] - Error authenticating ${socket.id} for ${options.form.channel_name}`);
90+
Log.error(`[${new Date().toISOString()}] - Error authenticating ${socket.id} for ${options.form.channel_name}`);
9191
Log.error(error);
9292
}
9393

9494
reject({ reason: 'Error sending authentication request.', status: 0 });
9595
} else if (response.statusCode !== 200) {
9696
if (this.options.devMode) {
97-
Log.warning(`[${new Date().toLocaleTimeString()}] - ${socket.id} could not be authenticated to ${options.form.channel_name}`);
97+
Log.warning(`[${new Date().toISOString()}] - ${socket.id} could not be authenticated to ${options.form.channel_name}`);
9898
Log.error(response.body);
9999
}
100100

101101
reject({ reason: 'Client can not be authenticated, got HTTP status ' + response.statusCode, status: response.statusCode });
102102
} else {
103103
if (this.options.devMode) {
104-
Log.info(`[${new Date().toLocaleTimeString()}] - ${socket.id} authenticated for: ${options.form.channel_name}`);
104+
Log.info(`[${new Date().toISOString()}] - ${socket.id} authenticated for: ${options.form.channel_name}`);
105105
}
106106

107107
try {

0 commit comments

Comments
 (0)