Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: implement a close function (deprecate kthxbye) #196

Open
cuzzlor opened this issue Jul 21, 2022 · 0 comments
Open

Request: implement a close function (deprecate kthxbye) #196

cuzzlor opened this issue Jul 21, 2022 · 0 comments
Assignees

Comments

@cuzzlor
Copy link

cuzzlor commented Jul 21, 2022

Why this request

  • Winston transports have an optional close() function defined.
  • Having to use kthxbye (not typed / standard) makes use with typescript painful and requires special treatment for cloudwatch transports vs other transports.

Action requested
Would it be too much trouble to add a close() function that runs kthxbye((error) => console.log(error))?

Type definitions

// Type definitions for winston-transport 3.0
// Project: https://github.com/winstonjs/winston-transport
// Definitions by: DABH <https://github.com/DABH>
// Definitions: https://github.com/winstonjs/winston-transport

/// <reference types="node" />

import * as stream from 'stream';
import * as logform from 'logform';

declare class TransportStream extends stream.Writable {
  public format?: logform.Format;
  public level?: string;
  public silent?: boolean;
  public handleExceptions?: boolean;
  public handleRejections?: boolean;

  constructor(opts?: TransportStream.TransportStreamOptions);

  public log?(info: any, next: () => void): any;
  public logv?(info: any, next: () => void): any;
  public close?(): void;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants