How to use the nodemailer/lib/shared.getLogger function in nodemailer

To help you get started, we’ve selected a few nodemailer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nodemailer / smtp-server / lib / smtp-server.js View on Github external
.trim()
        );

        // setup allowed auth methods
        this.options.authMethods = [].concat(this.options.authMethods || []).map(method =>
            (method || '')
                .toString()
                .toUpperCase()
                .trim()
        );

        if (!this.options.authMethods.length) {
            this.options.authMethods = ['LOGIN', 'PLAIN'];
        }

        this.logger = shared.getLogger(this.options, {
            component: this.options.component || 'smtp-server'
        });

        // apply shorthand handlers
        ['onConnect', 'onAuth', 'onMailFrom', 'onRcptTo', 'onData', 'onClose'].forEach(handler => {
            if (typeof this.options[handler] === 'function') {
                this[handler] = this.options[handler];
            }
        });

        /**
         * Timeout after close has been called until pending connections are forcibly closed
         */
        this._closeTimeout = false;

        /**