0.6.3 • Published 2 months ago

@emigrate/reporter-pino v0.6.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

@emigrate/reporter-pino

A Pino reporter for Emigrate which logs the migration progress using line delimited JSON by default.
Which is great both in production environments and for piping the output to other tools.

Installation

Install the reporter in your project, alongside the Emigrate CLI:

npm install @emigrate/cli @emigrate/reporter-pino
# or
pnpm add @emigrate/cli @emigrate/reporter-pino
# or
yarn add @emigrate/cli @emigrate/reporter-pino
# or
bun add @emigrate/cli @emigrate/reporter-pino

Usage

With default options

Configure the reporter in your emigrate.config.js file:

import reporterPino from '@emigrate/reporter-pino';

export default {
  directory: 'migrations',
  reporter: reporterPino,
};

Or simply:

export default {
  directory: 'migrations',
  reporter: 'pino', // the @emigrate/reporter- prefix is optional
};

Or use the CLI option --reporter (or -r):

emigrate up --reporter pino  # the @emigrate/reporter- prefix is optional

With custom options

Configure the reporter in your emigrate.config.js file:

import { createPinoReporter } from '@emigrate/reporter-pino';

export default {
  directory: 'migrations',
  reporter: createPinoReporter({
    level: 'error', // default is 'info'
    errorKey: 'err', // default is 'error'
  }),
};

The log level can also be set using the LOG_LEVEL environment variable:

LOG_LEVEL=error emigrate up -r pino
0.6.3

2 months ago

0.6.2

3 months ago

0.6.1

4 months ago

0.6.0

4 months ago

0.5.0

4 months ago

0.4.3

5 months ago

0.4.1

5 months ago

0.4.0

5 months ago

0.4.2

5 months ago

0.3.0

5 months ago

0.3.1

5 months ago

0.2.1

5 months ago

0.2.0

5 months ago

0.1.1

6 months ago

0.1.0

6 months ago