Skip to content

Add morgan support #2

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

Merged
merged 5 commits into from
Jan 28, 2020
Merged

Add morgan support #2

merged 5 commits into from
Jan 28, 2020

Conversation

delvedor
Copy link
Member

As titled.

The helpers have been moved to their own package, so they can be reused among the loggers libraries.

@delvedor delvedor merged commit db19e73 into master Jan 28, 2020
@delvedor delvedor deleted the add-morgan branch January 28, 2020 14:24
trentm added a commit that referenced this pull request Oct 27, 2023
This updates the three @elastic/ecs-*-format packages to support the following
import styles from JS and TS code:
1. `const { ecsFormat } = require('@elastic/ecs-pino-format);` in JS and TS.
   The preferred import style for JS code using CommonJS.
2. `import { ecsFormat } from '@elastic/ecs-pino-format';` in JS and TS.
   ES module (ESM) import style. This is the preferred style for TypeScript
   code and for JS developers using ESM.
3. `const ecsFormat = require('@elastic/ecs-pino-format');` in JS.
   The old, deprecated import method. Still supported for backward compat.
4. `import ecsFormat from '@elastic/ecs-pino-format';` in JS and TS.
   This works, but is deprecated. Prefer #2 style.
5. `import * as EcsPinoFormat from '@elastic/ecs-pino-format';` in TS.
   One must then use `EcsPinoFormat.ecsFormat()`.

Note that this *excludes* support for this TS-only style:
`import escFormat = require('@elastic/ecs-pino-format');`

This also adds types for ecs-morgan-format, based on #119 and #90.
I'd had an earlier start on this in #96.

Replaces: #96
Closes: #90
Closes: #119
trentm added a commit that referenced this pull request Oct 30, 2023
…#165)

This updates the three @elastic/ecs-*-format packages to support the following
import styles from JS and TS code:
1. `const { ecsFormat } = require('@elastic/ecs-pino-format);` in JS and TS.
   The preferred import style for JS code using CommonJS.
2. `import { ecsFormat } from '@elastic/ecs-pino-format';` in JS and TS.
   ES module (ESM) import style. This is the preferred style for TypeScript
   code and for JS developers using ESM.
3. `const ecsFormat = require('@elastic/ecs-pino-format');` in JS.
   The old, deprecated import method. Still supported for backward compat.
4. `import ecsFormat from '@elastic/ecs-pino-format';` in JS and TS.
   This works, but is deprecated. Prefer #2 style.
5. `import * as EcsPinoFormat from '@elastic/ecs-pino-format';` in TS.
   One must then use `EcsPinoFormat.ecsFormat()`.

Note that this *excludes* support for this TS-only style:
`import escFormat = require('@elastic/ecs-pino-format');`

This also adds types for ecs-morgan-format, based on #119 and #90.
I'd had an earlier start on this in #96.

Replaces: #96
Closes: #90
Closes: #119
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant