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

Empty line in logs #5

Closed
JamesCullum opened this issue Sep 14, 2016 · 6 comments
Closed

Empty line in logs #5

JamesCullum opened this issue Sep 14, 2016 · 6 comments

Comments

@JamesCullum
Copy link

In the console and every log file there is always a blank line after every log line (Windows). I guess there is a \n too much?!

@antigloss
Copy link
Owner

Don't place \n yourself in the log text. Logger automatically place \n at the end of the log text.

@JamesCullum
Copy link
Author

I dont, thats the issue.

@antigloss
Copy link
Owner

OK. I'll have a look when I'm home. Your Go version please.

@JamesCullum
Copy link
Author

JamesCullum commented Sep 15, 2016

Newest, 1.7 on win32

@antigloss
Copy link
Owner

antigloss commented Sep 18, 2016

Tested under Ubuntu 16.04 and Win7 with Go 1.7, found no problem. What's your Windows version? XP? 10?

Here is my testing code:

package main

import (
"github.com/antigloss/go/logger"
)

func main() {
logger.Init("./log", 400, 20, 100, false)
logger.SetLogToConsole(true)
logger.Info("Failed to find player! uid=%d plid=%d cmd=%s xxx=%d", 1234, 678942, "getplayer", 102020101)
logger.Warn("Failed to parse protocol!")
logger.Info("Failed to find player! uid=%d plid=%d cmd=%s xxx=%d", 1234, 678942, "getplayer", 102020101)
logger.Info("Failed to find player! uid=%d plid=%d cmd=%s xxx=%d", 1234, 678942, "getplayer", 102020101)
logger.Info("Failed to find player! uid=%d plid=%d cmd=%s xxx=%d", 1234, 678942, "getplayer", 102020101)
logger.Info("Failed to find player! uid=%d plid=%d cmd=%s xxx=%d", 1234, 678942, "getplayer", 102020101)
}

@JamesCullum
Copy link
Author

Oh sorry, i just realized that my fork modification was responsible for that issue.

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