Open noreabu opened 7 years ago
Hello! I'm just going through some older PRs, trying to merge them into rlog. I would like to include your example, but do you think it's possible to have a main() function in there, so that it can be started like the other example with something like go run examples/setLogLevelsViaGetRequest.go
, or similar?
i am pretty new to this. hope i got it right.
This is better. However, considering that this gives you a chance to change the log level with a GET request, it would be great if the main function could show that: Run/install the handler function, and at the same time - in an endless loop - provide an ongoing "once a second" output of a few lines with a certain log or trace level. Then the user could issue a 'wget' or 'curl' request to the URL and see how the ongoing output changes. The main function should print a starting message explaining the URL and the parameters.
That would be a neat demo.
you are right, that would be are very nice demo indeed. I'll look into it later and see if i can adapt it to the net/http package instead of gin-gonic.
…TP GET handler in gin-gonic
I hope this time the account name is ok...
It could be refactored in a way, so that log and trace level could be changed by a public rlog function instead of changing the config file. But that would require changes to the rlog code.