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

Make Logger service public available #50

Closed
artaommahe opened this issue May 9, 2017 · 4 comments
Closed

Make Logger service public available #50

artaommahe opened this issue May 9, 2017 · 4 comments

Comments

@artaommahe
Copy link

artaommahe commented May 9, 2017

To prevent additional loggers usages make existing Logger service public available.
Also extend declaration for INestMicroservice with logger field to allow app.logger.log(...) usage on startup instead of console.log('Microservice is listening on port 3000')) from examples.
Also made logMessage method public to print messages with custom colors.

@cojack
Copy link
Contributor

cojack commented May 11, 2017

import { Module } from 'nest.js';
import { Logger } from 'nest.js/common/services/logger.service'

@Module({
    modules: []
})
export class ApplicationModule {
    private logger: Logger;

    constructor() {
        this.logger = new Logger(ApplicationModule.name);
        this.logger.log('Hello nest.js');
    }
}

@artaommahe you're welcome

@artaommahe
Copy link
Author

artaommahe commented May 11, 2017

@cojack i know how to import directly from sources, but this nest.js/common/services/logger.service is private and coupled with lib files structure that can be change. Public is import { } from 'nest.js/common'

@kamilmysliwiec
Copy link
Member

Hi @artaommahe,
Logger is now a part of the public API (@nestjs/common package).

@lock
Copy link

lock bot commented Sep 25, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants