open-index/open-npm huggingface dataset:
npm package: @moonbasehq/pino
Description: Install the `@moonbasehq/pino` package
Author: Brodey Newman brodey@moonbasehq.com
Latest version: 0.0.1

## Quickstart

Install the `@moonbasehq/pino` package

```bash
pnpm i --save @moonbasehq/pino
```

Create your pino logger

```typescript
import pino from 'pino';

const transport = pino.transport({
  targets: [
    {
      target: '@moonbasehq/pino',
      options: {
        projectId: 'clxaua3q10004zg0q5p7qvjyj',
        apiKey: 'moonbase_...',
      },
    },
    // you can use pino-pretty to pipe to stdout alongside Moonbase
    {
      target: 'pino-pretty',
      options: {
        colorize: true,
        translateTime: 'HH:MM:ss Z',
        ignore: 'pid,hostname',
      },
    }
  ],
  dedupe: true,
});

const logger = pino(transport);

logger.info('Hello world')
```

## Usage with Fastify

```typescript
import fastify from 'fastify';
import pino from 'pino';

const transport = pino.transport({
  targets: [
    {
      target: '@moonbasehq/pino',
      options: {
        projectId: 'clxaua3q10004zg0q5p7qvjyj',
        apiKey: 'moonbase_...',
      },
    },
    {
      target: 'pino-pretty',
      options: {
        colorize: true,
        translateTime: 'HH:MM:ss Z',
        ignore: 'pid,hostname',
      },
    }
  ],
  dedupe: true,
});

const logger = pino(transport);

const server = fastify({
  logger,
});

server.get('/', async (request, reply) => {
  request.server.log.info('Hello this is from the local app');

  return { hello: 'world' };
});

const start = async () => {
  try {
    await server.listen(3000, '0.0.0.0');
    server.log.info(`Server listening at http://0.0.0.0:3000`);
  } catch (err) {
    server.log.error(err);
    process.exit(1);
  }
};

logger.error('this is an example error log');

start();
```

### Results

![Results](./static/viewer.png)
npm package: @moonbasehq/winston
Description: Install the `@moonbasehq/winston` package
Author: Brodey Newman brodey@moonbasehq.com
Latest version: 0.0.0

## Quickstart

Install the `@moonbasehq/winston` package

```bash
pnpm i --save @moonbasehq/winston
```

Create your winston logger

```typescript
import { MoonbaseTransport } from '@moonbasehq/winston';

const logger = winston.createLogger({
  // Setup log level, change to 'trace' or 'debug' depending on your use case.
  level: 'info',
  // Setup logs format
  format: winston.format.json(),
  transports: [
    new MoonbaseTransport({
      projectId: 'clxaua3q10004zg0q5p7qvjyj',
        apiKey: 'moonbase_...',
    }),
  ],
});

logger.log({
  level: 'info',
  message: 'shipping to Moonbase...',
});
```

## Usage with Fastify

```typescript
import winston from 'winston';
import fastify from 'fastify';
import { MoonbaseTransport } from '@moonbasehq/winston';

const logger = winston.createLogger({
  // Setup log level, change to 'trace' or 'debug' depending on your use case.
  level: 'info',
  // Setup logs format
  format: winston.format.json(),
  transports: [
    new MoonbaseTransport({
      projectId: 'clxaua3q10004zg0q5p7qvjyj',
        apiKey: 'moonbase_...',
    }),
    // log to stdout as well...
    new winston.transports.Console()
  ],
});

const server = fastify();

server.get('/', async (request, reply) => {
  logger.info('Hello this is from the local app');

  return { hello: 'world' };
});

const start = async () => {
  try {
    await server.listen(3000, '0.0.0.0');
    logger.info(`Server listening at http://0.0.0.0:3000`);
  } catch (err) {
    logger.error(err);
    process.exit(1);
  }
};

logger.error('this is an example error log');

start();
```