Skip to content
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

Bring-your-own logger #640

Merged
merged 32 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3bff1c2
Bring-your-own logger
jpage-godaddy Dec 14, 2023
bd8bb0f
Fix linting
jpage-godaddy Dec 14, 2023
795f143
Try a clearer name
jpage-godaddy Dec 14, 2023
a379502
refactor: Updates to refactor ts code to js.
kawikabader Feb 8, 2024
a05cfb2
Merge branch 'v7' into byo-logger
kawikabader Feb 9, 2024
49c355d
chore: Update lock file
kawikabader Feb 9, 2024
fc2d1a8
fix: Fix express tests
kawikabader Feb 9, 2024
d5d9ab3
chore: Audit fix
kawikabader Feb 12, 2024
7cadd5c
chore: Align packages
kawikabader Feb 12, 2024
0900d51
chore: Update lock file from align packages
kawikabader Feb 12, 2024
338054b
fix: transport stubs
agerard-godaddy Feb 12, 2024
375530e
Update packages/gasket-plugin-winston/README.md
kbader-godaddy Feb 12, 2024
537eee6
feat: Replace logger "log" instances with "info".
kawikabader Feb 13, 2024
aa33955
refactor: Converted logger "logs" to "info"
kawikabader Feb 13, 2024
edc6154
chore: Lint fix.
kawikabader Feb 13, 2024
c76fdd3
refactor: Updated to use logger "warn" instead of "warning".
kawikabader Feb 13, 2024
e4f60e5
feat: Set required log levels
kawikabader Feb 20, 2024
204c91b
Update packages/gasket-plugin-winston/README.md
kbader-godaddy Feb 23, 2024
c282cea
remove: Remove gasket/log
kawikabader Feb 23, 2024
da1fa97
Update packages/gasket-plugin-winston/README.md
kbader-godaddy Feb 23, 2024
6b2797d
fix: PR feedback
kawikabader Feb 23, 2024
174a8f0
chore: Update minor deps
kawikabader Feb 26, 2024
a2f9eac
Merge branch 'v7' into byo-logger
kawikabader Feb 26, 2024
dcf4b81
fix: broken tests.
kawikabader Feb 26, 2024
34e886c
fix: Remove config log
kawikabader Feb 26, 2024
083b7e2
test: Update winston and logger pluggin types and tests.
kawikabader Feb 26, 2024
40ad9ea
chore: Run align packages and npm dedupe
kawikabader Feb 26, 2024
113175d
fix: Update lock file
kawikabader Feb 26, 2024
1b31488
fix: Regen package-lock
kawikabader Feb 26, 2024
08f2fe8
Regen package-lock
kawikabader Feb 26, 2024
0eb038d
Regen package-lock
kawikabader Feb 26, 2024
568626e
fix: attempt to fix lock file
agerard-godaddy Feb 26, 2024
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ typings/
.docs

# package-specific generated files
packages/gasket-log/lib
packages/gasket-redux/lib
packages/gasket-assets/react
packages/gasket-nextjs/lib
Expand Down
2 changes: 0 additions & 2 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

/packages/gasket-cli/ @indexzero, @kinetifex
kbader-godaddy marked this conversation as resolved.
Show resolved Hide resolved
/packages/gasket-engine/ @DullReferenceException, @indexzero
/packages/gasket-log/ @Swaagie
/packages/gasket-intl/ @salilagrawal
/packages/gasket-fetch/ @kinetifex
/packages/gasket-plugin-command/ @DullReferenceException
Expand All @@ -25,7 +24,6 @@
/packages/gasket-plugin-https/ @SivanMehta
/packages/gasket-plugin-lint/ @kinetifex
/packages/gasket-plugin-intl/ @salilagrawal
/packages/gasket-plugin-log/ @Swaagie
/packages/gasket-plugin-manifest/ @SivanMehta, @kinetifex
/packages/gasket-plugin-metadata/ @kinetifex
/packages/gasket-plugin-metrics/ @SivanMehta
Expand Down
28 changes: 15 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ project.

No matter how you want to get involved, we ask that you first learn what’s
expected of anyone who participates in the project by reading the Contribution
Guidelines.
Guidelines.

## Answering Questions

One of the most important and immediate ways you can support this project is to
answer questions on [Github][issues]. Whether you’re helping a
newcomer understand a feature or troubleshooting an edge case with a seasoned
developer, your knowledge and experience with JS can go a long way to help
others.
answer questions on [Github][issues]. Whether you’re helping a newcomer
understand a feature or troubleshooting an edge case with a seasoned developer,
your knowledge and experience with JS can go a long way to help others.

## Reporting Bugs

Expand All @@ -29,6 +28,7 @@ please create a Github issue in that project. All dependencies are open source
software and can be easily found through [npm].

Submit a ticket for your issue, assuming one does not already exist:

- Create it on our [Issue Tracker][issues]
- Clearly describe the issue by following the template layout
- Make sure to include steps to reproduce the bug.
Expand All @@ -47,6 +47,7 @@ test that reproduces a bug in just a few lines of code is easier than reasoning
about a longer sample.

From a practical perspective, contributions are as simple as:

- Forking the repository on GitHub.
- Making changes to your forked repository.
- When committing, reference your issue (if present) and include a note about
Expand All @@ -58,8 +59,7 @@ From a practical perspective, contributions are as simple as:

If you are interested in making a large change and feel unsure about its overall
effect, please make sure to first discuss the change and reach a consensus with
core contributors. Then ask about the best way to go about
making the change.
core contributors. Then ask about the best way to go about making the change.

## Code Review

Expand All @@ -79,8 +79,8 @@ patches:
to do the same for you. Good will is our currency.
- Split your change into multiple smaller changes. The smaller your change, the
higher the probability that somebody will take a quick look at it.
- Remember that you’re asking for valuable
time from other professional developers.
- Remember that you’re asking for valuable time from other professional
developers.

**Note that anyone is welcome to review and give feedback on a change, but only
people with commit access to the repository can approve it.**
Expand Down Expand Up @@ -108,7 +108,7 @@ in a book when used with `gasket docs`. Different styles and layouts can result
in a disjointed experience for readers. In general, and certainly for the
top-level README, the following headings should be used.

```
```md
# Name of package

Short one or two sentence summary.
Expand Down Expand Up @@ -162,6 +162,7 @@ Include a LICENSE.md file and link to it.
```

Some additional rules to note:

- Examples should always use `####` heading (H4)
- Example headings should always begin with "Example"
- Good:
Expand All @@ -179,14 +180,15 @@ Some additional rules to note:

## Adding new packages to the monorepo

Remember to run the `align-packages` script for new packages. This has been
an issue in the past with `docs-graphs` missing the `publishConfig` field which
Remember to run the `align-packages` script for new packages. This has been an
issue in the past with `docs-graphs` missing the `publishConfig` field which
messed with `lerna publish`. Without this, we had to step into each package and
manually re-publish the ones that didn’t make it out.

## File and Directory Naming

File and directory names should follow kebab-casing. Incorrect naming will generate a linting error.
File and directory names should follow kebab-casing. Incorrect naming will
generate a linting error.

```
new-file.js
Expand Down
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ Available lifecycles
| [composeServiceWorker] | Update the service worker script |
| [configure] | Allows plugins to adjust config before command is run |
| [create][2] | App level plugins |
| [createLogger] | Custom logger creation |
| [createServers] | Setup the `create-servers` options |
| [docsGenerate] | Generate graphs for display in documation |
| [docsSetup] | Set up what docs are captured and how to transform them |
Expand All @@ -95,7 +96,6 @@ Available lifecycles
| [initReduxStore] | Plugin access to Redux store instance |
| [initWebpack] | Create a webpack config |
| [intlLocale] | Set the language for which locale files to load |
| [logTransports] | Setup Winston log transports |
| [manifest] | Modify the the web manifest for a request |
| [metadata] | Allows plugins to adjust their metadata |
| [metrics] | Collect metrics for an app |
Expand All @@ -117,6 +117,7 @@ Available lifecycles
| [webpack (deprecated)][webpack (deprecated)] | Modify webpack config with partials or by mutating |
| [webpackChain (deprecated)][webpackChain (deprecated)] | Setup webpack config by chaining |
| [webpackConfig] | Transform the webpack config, with the help of webpack-merge |
| [winstonTransports] | Setup Winston log transports |
| [workbox] | Setup Workbox config and options |

## Structures
Expand Down Expand Up @@ -174,7 +175,7 @@ Available plugins
| [@gasket/plugin-jest] | 6.45.0 | Integrated jest into your application. |
| [@gasket/plugin-lifecycle] | 6.45.0 | Allows a gasket/ directory to be used for lifecycle hooks in applications. |
| [@gasket/plugin-lint] | 6.45.0 | Adds GoDaddy standard linting to your application |
| [@gasket/plugin-log] | 6.45.0 | Gasket log plugin |
| [@gasket/plugin-logger] | 6.43.0 | Gasket plugin for logging |
| [@gasket/plugin-manifest] | 6.45.0 | The web app manifest for progressive Gasket applications |
| [@gasket/plugin-metadata] | 6.45.0 | Adds metadata to gasket lifecycles |
| [@gasket/plugin-metrics] | 6.45.0 | Collect metrics for gasket commands |
Expand All @@ -186,6 +187,7 @@ Available plugins
| [@gasket/plugin-start] | 6.45.0 | Adds commands for building and starting Gasket apps |
| [@gasket/plugin-swagger] | 6.45.0 | Generate and serve swagger docs |
| [@gasket/plugin-webpack] | 6.45.0 | Adds webpack support to your application |
| [@gasket/plugin-winston] | 6.43.0 | Gasket logger based on Winston |
| [@gasket/plugin-workbox] | 6.45.0 | Gasket Workbox Plugin |

## Modules
Expand All @@ -200,7 +202,6 @@ Supporting modules
| [@gasket/engine] | 6.45.0 | Plugin engine for gasket |
| [@gasket/fetch] | 6.45.0 | Gasket Fetch API |
| [@gasket/helper-intl] | 6.45.0 | Internal helpers used by loaders to resolve locale file paths |
| [@gasket/log] | 6.45.0 | Gasket client and server logger |
| [@gasket/nextjs] | 6.45.0 | Gasket integrations for Next.js apps |
| [@gasket/react-intl] | 6.45.0 | React component library to enable localization for gasket apps. |
| [@gasket/redux] | 6.45.0 | Gasket Redux Configuration |
Expand Down Expand Up @@ -252,8 +253,6 @@ Available configuration options in the `gasket.config.js`
| [intl.modules] | Enable locale files collation from node modules | boolean | object | |
| [intl.nextRouting] | Enable Next.js Routing when used with @gasket/plugin-nextjs | boolean | true |
| [intl.serveStatic] | Enables ability to serve static locale files | boolean | string | locales-manifest.json |
| [log] | Setup and customize logger | object | |
| [log.prefix] | Used to set the prefix in the winston format | string | |
| [manifest][10] | Manifest plugin config | object | |
| [morgan] | Morgan plugin configuration | object | |
| [morgan.format] | Log format to print | string | tiny |
Expand Down Expand Up @@ -313,6 +312,7 @@ Available configuration options in the `gasket.config.js`
[composeServiceWorker]:/packages/gasket-plugin-service-worker/README.md#composeServiceWorker
[configure]:/packages/gasket-plugin-command/README.md#configure
[2]:/packages/gasket-cli/README.md#create
[createLogger]:/packages/gasket-plugin-logger/README.md#createLogger
[createServers]:/packages/gasket-plugin-https/README.md#createServers
[docsGenerate]:/packages/gasket-plugin-docs/README.md#docsGenerate
[docsSetup]:/packages/gasket-plugin-docs/README.md#docsSetup
Expand All @@ -327,7 +327,6 @@ Available configuration options in the `gasket.config.js`
[initReduxStore]:/packages/gasket-plugin-redux/README.md#initReduxStore
[initWebpack]:/packages/gasket-plugin-webpack/README.md#initwebpack
[intlLocale]:/packages/gasket-plugin-intl/README.md#intlLocale
[logTransports]:/packages/gasket-plugin-log/README.md#logTransports
[manifest]:/packages/gasket-plugin-manifest/README.md#manifest
[metadata]:/packages/gasket-plugin-metadata/README.md#metadata
[metrics]:/packages/gasket-plugin-metrics/README.md#metrics
Expand All @@ -349,6 +348,7 @@ Available configuration options in the `gasket.config.js`
[webpack (deprecated)]:/packages/gasket-plugin-webpack/README.md#webpack
[webpackChain (deprecated)]:/packages/gasket-plugin-webpack/README.md#webpackChain
[webpackConfig]:/packages/gasket-plugin-webpack/README.md#webpackConfig
[winstonTransports]:/packages/gasket-plugin-winston/README.md#winstonTransports
[workbox]:/packages/gasket-plugin-workbox/README.md#workbox
[.docs/]:/packages/gasket-plugin-docs/README.md#options
[config/]:/packages/gasket-plugin-config/README.md
Expand Down Expand Up @@ -383,7 +383,7 @@ Available configuration options in the `gasket.config.js`
[@gasket/plugin-jest]:/packages/gasket-plugin-jest/README.md
[@gasket/plugin-lifecycle]:/packages/gasket-plugin-lifecycle/README.md
[@gasket/plugin-lint]:/packages/gasket-plugin-lint/README.md
[@gasket/plugin-log]:/packages/gasket-plugin-log/README.md
[@gasket/plugin-logger]:/packages/gasket-plugin-logger/README.md
[@gasket/plugin-manifest]:/packages/gasket-plugin-manifest/README.md
[@gasket/plugin-metadata]:/packages/gasket-plugin-metadata/README.md
[@gasket/plugin-metrics]:/packages/gasket-plugin-metrics/README.md
Expand All @@ -395,14 +395,14 @@ Available configuration options in the `gasket.config.js`
[@gasket/plugin-start]:/packages/gasket-plugin-start/README.md
[@gasket/plugin-swagger]:/packages/gasket-plugin-swagger/README.md
[@gasket/plugin-webpack]:/packages/gasket-plugin-webpack/README.md
[@gasket/plugin-winston]:/packages/gasket-plugin-winston/README.md
[@gasket/plugin-workbox]:/packages/gasket-plugin-workbox/README.md
[@gasket/assets]:/packages/gasket-assets/README.md
[@gasket/cli]:/packages/gasket-cli/README.md
[@gasket/data]:/packages/gasket-data/README.md
[@gasket/engine]:/packages/gasket-engine/README.md
[@gasket/fetch]:/packages/gasket-fetch/README.md
[@gasket/helper-intl]:/packages/gasket-helper-intl/README.md
[@gasket/log]:/packages/gasket-log/README.md
[@gasket/nextjs]:/packages/gasket-nextjs/README.md
[@gasket/react-intl]:/packages/gasket-react-intl/README.md
[@gasket/redux]:/packages/gasket-redux/README.md
Expand Down Expand Up @@ -447,8 +447,6 @@ Available configuration options in the `gasket.config.js`
[intl.modules]:/packages/gasket-plugin-intl/README.md#configuration
[intl.nextRouting]:/packages/gasket-plugin-intl/README.md#configuration
[intl.serveStatic]:/packages/gasket-plugin-intl/README.md#configuration
[log]:/packages/gasket-plugin-log/README.md#configuration
[log.prefix]:/packages/gasket-plugin-log/README.md#configuration
[10]:/packages/gasket-plugin-manifest/README.md#configuration
[morgan]:/packages/gasket-plugin-morgan/README.md#configuration
[morgan.format]:/packages/gasket-plugin-morgan/README.md#configuration
Expand All @@ -473,7 +471,7 @@ Available configuration options in the `gasket.config.js`
[swagger.ui]:/packages/gasket-plugin-swagger/README.md#configuration
[12]:/packages/gasket-plugin-https/README.md#configuration
[terminus.healthcheck]:/packages/gasket-plugin-https/README.md#configuration
[winston]:/packages/gasket-plugin-log/README.md#configuration
[winston]:/packages/gasket-plugin-winston/README.md#configuration
[13]:/packages/gasket-plugin-workbox/README.md#configuration
[workbox.basePath]:/packages/gasket-plugin-workbox/README.md#configuration
[workbox.config]:/packages/gasket-plugin-workbox/README.md#configuration
Expand Down
3 changes: 2 additions & 1 deletion docs/generated-docs/lifecycle-graphs.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ middleware -- execWaterfall --> appRequestConfig;
express -- execWaterfall --> composeServiceWorker;
init -- execWaterfall --> configure;
gasket/cli --> create;
init -- exec --> createLogger;
start -- execWaterfall --> createServers;
docsSetup -- exec --> docsGenerate;
docs-cmd(docs) --> docsSetup;
Expand All @@ -19,7 +20,6 @@ middleware -- execWaterfall --> initReduxState;
middleware -- exec --> initReduxStore;
build-cmd(build) --> initWebpack;
middleware -- execWaterfall --> intlLocale;
init -- exec --> logTransports;
middleware -- execWaterfall --> manifest;
init -- execApply --> metadata;
init -- exec --> metrics;
Expand All @@ -41,6 +41,7 @@ start -- execWaterfall --> terminus;
initWebpack -- execSync --> webpack["webpack (deprecated)"];
initWebpack -- execSync --> webpackChain["webpackChain (deprecated)"];
initWebpack -- execWaterfallSync --> webpackConfig;
createLogger -- exec --> winstonTransports;
composeServiceWorker -- exec --> workbox;
style docs-cmd fill: red;
style *-cmd fill: red;
Expand Down
Loading