-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## What is this PR doing? It moves away from using the JS logger (console) to the `@php-wasm/logger`. ## What problem is it solving? It centralizes log collections which will allow us to better utilize logs in the future. ## How is the problem addressed? By replacing console calls with logger calls. ## Testing Instructions - Checkout this branch - [Open this blueprint](http://localhost:5400/website-server/?blueprint-url=https://gist.githubusercontent.com/bgrgicak/5fbeb98abec8221192a8b619f852148a/raw/75ff00581b76d9ed3e4844d228dce9b4eda1b163/error-log-blueprint.json) - Open the report error modal (menu in upper right corner > Report error) - See JS logs in the _LOGS_ textarea **Please review the log messages in this PR and suggest changes (using the GitHub suggest feature) to messages if they could be improved.** --------- Co-authored-by: Adam Zielinski <adam@adamziel.com>
- Loading branch information
Showing
34 changed files
with
114 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 1 addition & 4 deletions
5
packages/php-wasm/logger/src/lib/collectors/collect-php-logs.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
export interface UniversalPHP { | ||
/** | ||
* Read the content of a file as text. | ||
* | ||
* @param path The path to the file | ||
* @returns string The content of the file | ||
*/ | ||
readFileAsText(path: string): Promise<string>; | ||
/** | ||
* Check if a file exists. | ||
* | ||
* @param path The path to the file | ||
* @returns boolean Whether the file exists | ||
*/ | ||
fileExists(path: string): Promise<boolean>; | ||
|
||
addEventListener( | ||
event: string, | ||
listener: (event: PHPRequestEndEvent | PHPRequestErrorEvent) => void | ||
): void; | ||
} | ||
|
||
export interface PHPRequestErrorEvent { | ||
type: 'request.error'; | ||
error: Error; | ||
source?: 'request' | 'php-wasm'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.