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

What happened to SetLogFile? #17

Closed
goarchit opened this issue Jan 6, 2017 · 1 comment
Closed

What happened to SetLogFile? #17

goarchit opened this issue Jan 6, 2017 · 1 comment

Comments

@goarchit
Copy link

goarchit commented Jan 6, 2017

    switch config.GetInt("LogLevel") {

25 case 0:
26 jww.SetLogThreshold(jww.LevelError)
27 jww.SetStdoutThreshold(jww.LevelWarn)
28 case 1:
29 jww.SetLogThreshold(jww.LevelWarn)
30 jww.SetStdoutThreshold(jww.LevelInfo)
31 case 2:
32 jww.SetLogThreshold(jww.LevelInfo)
33 jww.SetStdoutThreshold(jww.LevelInfo)
34 case 3:
35 jww.SetLogThreshold(jww.LevelDebug)
36 jww.SetStdoutThreshold(jww.LevelDebug)
37 default:
38 jww.FATAL.Println("Invalid debug level specified:", config.GetInt("LogLevel"))
39 }
40 jww.SetLogFile(config.GetString("LogFile"))

Results in a ./archit.go:40: undefined: jwalterweatherman.SetLogFile
compilation error. All the other functions appear to compile fine.

@bep
Copy link
Collaborator

bep commented Jan 6, 2017

I refurbished this library a couple of days ago so you can use in a non-global context, with one breaking change.

Use:

 SetLogOutput(handle io.Writer)

And provide a os.File or another writer of choice.

@bep bep closed this as completed Jan 6, 2017
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