pki-io / admin

Other
15 stars 7 forks source link

Logging #3

Closed zeroXten closed 9 years ago

zeroXten commented 9 years ago

Need to look at nice logging packages (or built in?) and choose one for CLI. Presume packages will continue to just return an error with fmt.Errorf() but at the moment we've just been doing panic() in the CLI.

zeroXten commented 9 years ago

This has been started now, using seelog. Need to choose some sort of default logger.

jonbonazza commented 9 years ago

Yea, for the default logger, I don't think there is a way to initialize a logging interface directly, but we can do it from string, so we could embed some default config in a constant and then in the init() function (where I am setting the logger to seelog.Disabled right now), we can initialize the logger global variable from the string.

zeroXten commented 9 years ago

Makes sense. It should probably log to STDERR, up to and including INFO by default using a fairly clean format. Perhaps no timestamp.

jonbonazza commented 9 years ago

Okay. That's simple enough. No debug logging by default then?

On Tue, Jan 27, 2015, 3:55 PM Fraser Scott notifications@github.com wrote:

Makes sense. It should probably log to STDERR, up to and including INFO by default using a fairly clean format. Perhaps no timestamp.

— Reply to this email directly or view it on GitHub https://github.com/pki-io/admin/issues/3#issuecomment-71754630.

jonbonazza commented 9 years ago

Also, do we want anything fancy for defaults, such as rolling file? File archiving? For that matter do we want to enable files by default at all or just console output?

On Tue, Jan 27, 2015, 6:19 PM Jon Bonazza jonbonazza@gmail.com wrote:

Okay. That's simple enough. No debug logging by default then?

On Tue, Jan 27, 2015, 3:55 PM Fraser Scott notifications@github.com wrote:

Makes sense. It should probably log to STDERR, up to and including INFO by default using a fairly clean format. Perhaps no timestamp.

— Reply to this email directly or view it on GitHub https://github.com/pki-io/admin/issues/3#issuecomment-71754630.

thanasisk commented 9 years ago

I would vote for a timestamp

zeroXten commented 9 years ago

Fair enough, keep it in. This is just for default, running a command output. Like running apt, vagrant, openssl etc.

jonbonazza commented 9 years ago

I think for default we should treat it like a command output like Fraser mentioned. So no timestamp or log level display. It would be the same as if we were just doing fmt.Println().

Then they can override with their own formats and rolling files and archiving, etc..

On Wed Jan 28 2015 at 4:52:07 AM Fraser Scott notifications@github.com wrote:

Fair enough, keep it in. This is just for default, running a command output. Like running apt, vagrant, openssl etc.

— Reply to this email directly or view it on GitHub https://github.com/pki-io/admin/issues/3#issuecomment-71830052.

thanasisk commented 9 years ago

Ok, no timestamp then, given eventually it will be an API client.

zeroXten commented 9 years ago

This is in place now with nice default logging.