dbrain / soggy

An fast and simple express/sinatra like web framework.. thing.. for Go.
45 stars 1 forks source link

Better logging #18

Open dbrain opened 12 years ago

dbrain commented 12 years ago

As someone who actually likes to debug things sometimes, I'd like some better logging from soggy. Some ideas:

asenchi commented 12 years ago

Love the UID on request. I use that idea on every service I build at work, makes life so much easier. :)

Also, you could build in verbosity around SOGGY_ENV (Ref. #2), say if it defaulted to 'development'. Lots of flexibility to be found here (from my experience with RACK_ENV and Ruby).

dbrain commented 12 years ago

@asenchi Yeah, it would be really handy. Looking at doing this at the moment, just trying to find the fastest method thats "unique enough" for log filtering.

RACK_ENV/NODE_ENV is where I got the idea from. I might put some code in soon (to default to development) just so the standards floating around, and work out what I'll actually do with it framework wise later.

asenchi commented 12 years ago

I recommend a version 4 UUID like Ruby's SecureRandom.uuid generates.

asenchi commented 12 years ago

This might be helpful.

dbrain commented 12 years ago

I've added the basic ctx.Req.ID, which is roughly a UUID v4 (without the dashing). Thinking about how to implement the logging nicely without getting in the users way.