Skip to content

Producing example on the front git page not working: fix suggestion #47

@zit0un

Description

@zit0un

In Producing part of the front page, here is the example you dropped:

var syslogProducer = require('glossy').Produce; // or wherever glossy lives

var msg = syslogProducer.produce({
    facility: 'local4', // these can either be a valid integer, 
    severity: 'error',  // or a relevant string
    host: 'localhost',
    appName: 'sudo',
    pid: '123',
    date: new Date(Date()),
    message: 'Nice, Neat, New, Oh Wow'
});

I found that syslogProducer is in fact a constructor, so your example doesn't work as is: one as to first initialize a new producer. Here is a suggestion:

const syslogProducer = new (require('glossy').Produce)() // or wherever glossy lives

const msg = syslogProducer.produce({
  facility: 'local4', // these can either be a valid integer,
  severity: 'error', // or a relevant string
  host: 'localhost',
  appName: 'sudo',
  pid: '123',
  date: new Date(),
  message: 'Nice, Neat, New, Oh Wow',
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions