-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- remove data repetition from 'info' objects - use structured loggging more consistently - consistent use of 'type' property on info objects
- Loading branch information
Showing
11 changed files
with
81 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,6 +130,8 @@ dist | |
.yarn/install-state.gz | ||
.pnp.* | ||
|
||
volume/cache | ||
|
||
# playwright | ||
/test-results/ | ||
/playwright-report/* | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,28 @@ | ||
import logger from '../utils/logger.js' | ||
import hash from '../utils/hasher.js' | ||
|
||
/** | ||
* Types of logging events. | ||
* | ||
* Use as a value for 'type' entry of {@link https://github.com/winstonjs/winston?tab=readme-ov-file#streams-objectmode-and-info-objects|`info` objects} | ||
*/ | ||
const types = { | ||
PageView: 'PageView', | ||
Request: 'Request', | ||
Response: 'Response', | ||
AppLifecycle: 'AppLifecycle', | ||
App: 'App', | ||
DataValidation: 'DataValidation', | ||
External: 'External' | ||
} | ||
|
||
const logPageView = (route, sessionID) => { | ||
logger.info({ | ||
type: 'PageView', | ||
pageRoute: route, | ||
message: `page view occurred for page: ${route}`, | ||
type: types.PageView, | ||
endpoint: route, | ||
message: 'page view', | ||
sessionId: hash(sessionID) | ||
}) | ||
} | ||
|
||
export { logPageView } | ||
export { logPageView, types } |