-
Notifications
You must be signed in to change notification settings - Fork 50
chore: remove console logs #262
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -561,9 +561,9 @@ Did you try connecting directly to this Durable Object? Try using getServerByNam | |
| connection: Connection, | ||
| ctx: ConnectionContext | ||
| ): void | Promise<void> { | ||
| console.log( | ||
| `Connection ${connection.id} connected to ${this.#ParentClass.name}:${this.name}` | ||
| ); | ||
| // console.log( | ||
| // `Connection ${connection.id} connected to ${this.#ParentClass.name}:${this.name}` | ||
| // ); | ||
| // console.log( | ||
| // `Implement onConnect on ${this.#ParentClass.name} to handle websocket connections.` | ||
| // ); | ||
|
|
@@ -573,12 +573,12 @@ Did you try connecting directly to this Durable Object? Try using getServerByNam | |
| * Called when a message is received from a connection. | ||
| */ | ||
| onMessage(connection: Connection, message: WSMessage): void | Promise<void> { | ||
| console.log( | ||
| `Received message on connection ${this.#ParentClass.name}:${connection.id}` | ||
| ); | ||
| console.info( | ||
| `Implement onMessage on ${this.#ParentClass.name} to handle this message.` | ||
| ); | ||
| // console.log( | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. receiving messages without handling them? |
||
| // `Received message on connection ${this.#ParentClass.name}:${connection.id}` | ||
| // ); | ||
| // console.info( | ||
| // `Implement onMessage on ${this.#ParentClass.name} to handle this message.` | ||
| // ); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -595,13 +595,13 @@ Did you try connecting directly to this Durable Object? Try using getServerByNam | |
| * Called when an error occurs on a connection. | ||
| */ | ||
| onError(connection: Connection, error: unknown): void | Promise<void> { | ||
| console.error( | ||
| `Error on connection ${connection.id} in ${this.#ParentClass.name}:${this.name}:`, | ||
| error | ||
| ); | ||
| console.info( | ||
| `Implement onError on ${this.#ParentClass.name} to handle this error.` | ||
| ); | ||
| // console.error( | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as onException, you probably don't want a websocket error that isn't handled |
||
| // `Error on connection ${connection.id} in ${this.#ParentClass.name}:${this.name}:`, | ||
| // error | ||
| // ); | ||
| // console.info( | ||
| // `Implement onError on ${this.#ParentClass.name} to handle this error.` | ||
| // ); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -610,9 +610,9 @@ Did you try connecting directly to this Durable Object? Try using getServerByNam | |
| onRequest(request: Request): Response | Promise<Response> { | ||
| // default to 404 | ||
|
|
||
| console.warn( | ||
| `onRequest hasn't been implemented on ${this.#ParentClass.name}:${this.name} responding to ${request.url}` | ||
| ); | ||
| // console.warn( | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we want to keep this one, or you'll get a request without a log, and won't know what to do here? |
||
| // `onRequest hasn't been implemented on ${this.#ParentClass.name}:${this.name} responding to ${request.url}` | ||
| // ); | ||
|
|
||
| return new Response("Not implemented", { status: 404 }); | ||
| } | ||
|
|
@@ -622,19 +622,19 @@ Did you try connecting directly to this Durable Object? Try using getServerByNam | |
| * @param error - The error that occurred. | ||
| */ | ||
| onException(error: unknown): void | Promise<void> { | ||
| console.error( | ||
| `Exception in ${this.#ParentClass.name}:${this.name}:`, | ||
| error | ||
| ); | ||
| console.info( | ||
| `Implement onException on ${this.#ParentClass.name} to handle this error.` | ||
| ); | ||
| // console.error( | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we want to keep this one, no? odd to have an exception that you haven't caught or handled here |
||
| // `Exception in ${this.#ParentClass.name}:${this.name}:`, | ||
| // error | ||
| // ); | ||
| // console.info( | ||
| // `Implement onException on ${this.#ParentClass.name} to handle this error.` | ||
| // ); | ||
| } | ||
|
|
||
| onAlarm(): void | Promise<void> { | ||
| console.log( | ||
| `Implement onAlarm on ${this.#ParentClass.name} to handle alarms.` | ||
| ); | ||
| // console.log( | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we want to keep this one, no? would be weird to set an alarm and not have overridden this |
||
| // `Implement onAlarm on ${this.#ParentClass.name} to handle alarms.` | ||
| // ); | ||
| } | ||
|
|
||
| async alarm(): Promise<void> { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one I could be convinced, but it is causing a problem?