Skip to content

Commit

Permalink
fix(logger): define info type
Browse files Browse the repository at this point in the history
  • Loading branch information
schmooky committed Sep 4, 2019
1 parent 2f5bcc2 commit 21006ab
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/utils/winstonSMTPTransport.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import nodeMailer from 'nodemailer';
import TransportStream from 'winston-transport';
import dotenv from 'dotenv';
import winston from 'winston';

dotenv.config();

Expand All @@ -15,7 +16,7 @@ class SMTPTransport extends TransportStream {
},
});

public log(info: any, callback: any): void { //! Уточнить типы или задать
public log(info: winston.LogEntry): void {
const mailOptions = {
from: process.env.EMAIL,
to: process.env.EMAIL,
Expand All @@ -31,10 +32,6 @@ class SMTPTransport extends TransportStream {
mailOptions.html = messages.join('<br>');

this.transporter.sendMail(mailOptions);

if (callback) {
setImmediate(callback);
}
}
}

Expand Down

0 comments on commit 21006ab

Please sign in to comment.