The Wayback Machine - http://web.archive.org/web/20201106231038/https://github.com/graphile/postgraphile-log-consola
Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

README.md

postgraphile-log-consola

This PostGraphile server plugin disables PostGraphile's query log and instead uses consola for logging.

Installation

yarn add postgraphile-log-consola

Usage - library

Use makePluginHook to load the plugin; see the PostGraphile server plugins docs for more details.

const { postgraphile, makePluginHook } = require("postgraphile");
const PostgraphileLogConsola = require("postgraphile-log-consola");

// Other server frameworks work similarly
const express = require("express");
const app = express();

const pluginHook = makePluginHook([PostgraphileLogConsola]); // 👈
app.use(
  postgraphile(process.env.DATABASE_URL, "public", {
    pluginHook, // 👈
    // ...
  })
);

app.listen(process.env.PORT || 3000);

Usage - CLI

NOTE: --plugins must always be the very first option you use on the CLI.

Also note that this plugin only affects the query log, so the other messages the CLI generates are not wrapped.

postgraphile --plugins postgraphile-log-consola -c my_db

About

Use consola for PostGraphile logging

Resources

License

Packages

No packages published
You can’t perform that action at this time.