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

[Question] Why does the Run func create its own logger? #72

Closed
lonnblad opened this issue Feb 8, 2015 · 1 comment
Closed

[Question] Why does the Run func create its own logger? #72

lonnblad opened this issue Feb 8, 2015 · 1 comment

Comments

@lonnblad
Copy link

lonnblad commented Feb 8, 2015

Hi

Noticed that the Run function creates it's own logger instead of using the potential attached logger when creating the negroni instance.

func (n *Negroni) Run(addr string) {
    l := log.New(os.Stdout, "[negroni] ", 0)
    l.Printf("listening on %s", addr)
    l.Fatal(http.ListenAndServe(addr, n))
}

Any reason for this?

BR
Fredrik

@codegangsta
Copy link
Contributor

It could technically use the attached logger. Doing so might make for a more complex solution with not a whole lot of benefit. Run is just a convenience function and all we want to know is what host:port Negroni is running on.

Closing this out. Hope I answered your question :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants