Nervously Proposing Marriage

    @cdssnc/logdriver

    0.0.2 • Public • Published

    CDS Log Driver 🇨🇦

    Maintainability

    Creates a standardized logging format for output + log collection.

    standardPayload = {
      cloudEventsVersion: "0.2",
      contentType: "text/plain",
      data: msg,
      eventID: uuidv4(),
      eventTime: new Date().toISOString(),
      eventType: "com.github.cds-snc." + level,
      eventTypeVersion: "1.0",
      source: "/"
    };

    Adapters

    StackDriver Node

    import { Logger, StackDriverNodeLogger } from "@cdssnc/logger";
    Logger.subscribe("error", StackDriverNodeLogger.log);
    Logger.debug("The message from the server"); //logs to console + StackDriver

    StackDriver Client

    import { Logger, StackDriverClient } from "@cdssnc/logger";
     
    StackDriverClient.init(
       "your-api-key",
       "your-project-id"
    );
     
    // window.onError should now catch and report to StackDriver
    Logger.subscribe("error", StackDriverClient.log);
    Logger.warn("Client side message sent to StackDriver");

    Keywords

    none

    Install

    npm i @cdssnc/logdriver

    DownloadsWeekly Downloads

    1

    Version

    0.0.2

    License

    none

    Unpacked Size

    34.5 kB

    Total Files

    9

    Last publish

    Collaborators

    • maxneuvians
    • stephenmcmurtry
    • timarney