Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Extract DEBUG_PACTO debugging logic into an actual logger #20

Closed
marcosccm opened this issue Sep 10, 2013 · 4 comments
Closed

Extract DEBUG_PACTO debugging logic into an actual logger #20

marcosccm opened this issue Sep 10, 2013 · 4 comments

Comments

@marcosccm
Copy link
Contributor

Instead of the current

if ENV['DEBUG_PACTO']
  #do something
end

we could put the logging behavior into a class. Then we can either pass an actual logger or a noop logger to anyone wanting to log debug information, no ugly ifs needed.

@jmmercadom
Copy link
Contributor

I will start working on a branch the first implementation of logging capabilities for Pacto.
I think that by default the logger should print to STDOUT, that makes sense right @marcosccm?

Stay tuned, I will post my updates soon.

@maxlinc
Copy link
Collaborator

maxlinc commented Sep 19, 2013

I'd prefer the built-in logger vs an external gem or hand-rolled logger, unless there's a strong case for using something else.

@jmmercadom
Copy link
Contributor

I don't have any preference, we can use now the built in logger and if we need something more "advance" in the future then move to a gem. I will write a wrapper (Pacto::Logger) so it will be easy to migrate to another logger if needed.

@cv
Copy link
Contributor

cv commented Sep 20, 2013

I remember seeing a bit of code that switches between a simple logger
(stdout print, mostly) and the default Rails logger if it's available. I'll
try to find it -- it was a pretty elegant bit of code.

On Fri, Sep 20, 2013 at 7:47 PM, jesusmercado notifications@github.comwrote:

I don't have any preference, we can use now the built in logger and if we
need something more "advance" in the future then move to a gem. I will
write a wrapper (Pacto::Logger) so it will be easy to migrate to another
logger if needed.


Reply to this email directly or view it on GitHubhttps://github.com//issues/20#issuecomment-24846134
.

jmmercadom added a commit that referenced this issue Sep 22, 2013
Logger class is just a wrapper around built in ruby logger. This way we
can replace the logger library on the future (if needed)
@maxlinc maxlinc mentioned this issue Sep 23, 2013
4 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants