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
logging system, syslog and abstraction improvements #54
Conversation
The logger is also designed for very high-performance, so be aware of that as well. |
In regards to questions. No problem with the In terms of the LogFile and PidFile, where would you move them to? They are part of the options package. I understand your thoughts on server vs daemon, but not sure where we would place them or if it is worth it to move them from the core options struct. |
Performance I kept this kind of logic of course, to prevent extra call to deeper functions: Options Tests |
I added to all the client message the cid following the same pattern:
Too I simplified the Log API remove the "f" functions |
I prefer no external dependencies, even for tests. In terms of log output, the cid was on the end of the log line, but I am happy to consider others. Looping in @cee-dub and @krobertson |
The gocheck improve the quality of the tests and make less tedious use it. Is a very well know library and a quasi-standard. I have beed using it the last 2 years. This library supports versioning so you are using a tag and this will be there forever https://labix.org/gocheck About the cid, just tell me the format and i will make the modifications. |
Máximo, do you have a specific proposal for how gocheck would improve the Cameron Walters On Tue, Oct 7, 2014 at 5:19 PM, Máximo Cuadros notifications@github.com
|
gocheck provides tons of asserts, instead make for each assert the condition and the message by hand like: if resp.StatusCode != 200 {
t.Fatalf("Expected a 200 response, got %d\n", resp.StatusCode)
} you only need write the assert like this: c.Assert(resp.StatusCode , Equals, 200) Another good reason is the TestCase pattern with the |
Saving a line of conditional statement does not seem like a winning Cameron Walters On Tue, Oct 7, 2014 at 5:51 PM, Máximo Cuadros notifications@github.com
|
This presentation also makes a strong case for using the standard library's http://present.go-steel-programmers.org/unit_testing/2014-08-28.slide |
I never seen this kind of problems with go-check, just makes the asserting and he is using the unnitest library for make it, why be involved in the traces in this way. In fact is a wrapper over the std library. Gustavo Niemeyer is one of the biggest contributors to Go outside of Google and his packages (this and others like mongo driver, yaml, etc) are used for thousands of projects. Anyway is a taste problem so dont worry :D |
@derekcollison can you take a look? I checked the benchmarks and the times are exactly the same. |
Yes apologize, might be a day or two but will.. I will try tonight. @ken, @cameron - you ok with new syntax? On Thu, Oct 9, 2014 at 10:27 AM, Máximo Cuadros notifications@github.com
|
/cc @krobertson @cee-dub |
// Check to see if we have this remote already registered. | ||
// This can happen when both servers have routes to each other. | ||
s := c.srv | ||
c.mu.Unlock() | ||
|
||
if s.addRoute(c) { | ||
Debug("Registering remote route", info.ID) | ||
Debug("[cid: %d] Registering remote route '%s'", c.cid, info.ID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor nit, but may be better to use %q
over %s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, good one. i need review some message too.
This is the new format:
The execution of clientConnStr not is at logger.go, to avoid unnecessary executions |
These are the new options, the PR is finished, I am waiting for comments:
|
ping |
@krobertson @cee-dub Can you two take a look and lmk. Want to make sure that the new format does not perturb any of our tooling, etc. |
I want add some things. Some times errors are printed as DEBUG or LOG and this should be printed as and ERROR even the verbose or debug are disabled. So i suggest add a Error function for this type of messages https://github.com/apcera/gnatsd/blob/master/server/route.go#L49 |
If you are parsing the message, then will breaks your production environment. The format message has changed. |
I agree with that.. On Tue, Oct 14, 2014 at 4:57 PM, Máximo Cuadros notifications@github.com
|
I think it looks good. @mcuadros could you squash the branch down to a single commit, and I can go ahead and merge. |
Thanks, its ok. We normally squash to a single commit with detailed commit messages, but it isn't a biggie. |
logging system, syslog and abstraction improvements
Arg, it looks like the govet script we're using for travis isn't working properly...
Travis failed to have it exit non-zero, so it looked green on the PR, however merging it triggered our internal build server to run it and it failed there. This is due to all the |
This is a false positive, because the number of args dont match the number of tokens in the string, if a |
That is the argument signature for formatting directive functions, so govet's rule processing is to recommend it being called |
go test -v -race ./... fails, we need to fix. On Wed, Oct 15, 2014 at 4:50 PM, Ken Robertson notifications@github.com
|
How is possible my PR was ok |
Not sure.. On Oct 17, 2014, at 2:36 PM, Máximo Cuadros notifications@github.com How is possible my PR was ok — |
https://travis-ci.org/apcera/gnatsd/builds/38102363 On Fri, Oct 17, 2014 at 11:45 PM, Derek Collison notifications@github.com
|
Travis built against master. Can you pull in this change? 738227a#diff-354f30a63fb0907d4ad57269548329e3 Cameron Walters On Fri, Oct 17, 2014 at 3:10 PM, Máximo Cuadros notifications@github.com
|
https://travis-ci.org/apcera/gnatsd/builds/38102363#L12 On Sat, Oct 18, 2014 at 1:39 AM, Cameron Walters (cee-dub) <
|
Please bring your branch up to date with master. –cw
|
This PR was merged and was working you can see the last test execution over my pr at: I just made:
And all looks correct, the last travis over master is saying something strange about https://travis-ci.org/apcera/gnatsd#L93 Can you execute again the the travis tests? Maybe was @krobertson :) #54 (comment) |
The build is failing because of govet. There was an issue with the build script where it wasn't failing properly though. I fixed it after merging this PR here: bc84847 Even in the build output on travis, can see the govet failure, just the govet.sh script didn't exit non-zero. I haven't seen go test or race failures. I started fixing the vet issues, but still stuck with two where the cid is passed in... 8332dfd |
Ok, so tell me if something is need it from this side. I am working in a new PR about auth. Good night! I need go to the bed Is too late here in Spain. On Sat, Oct 18, 2014 at 3:03 AM, Ken Robertson notifications@github.com
|
This is a WIP, this is a little roadmad and some questions I have.
server.Logger
interface and addserver.SetLogger
methodgnatsd
options and link Network syslogserver.SetLogger()
Questions:
alreadyFormatted
function? We can control this in the codebaseRelated to: #7