Code Monkey home page Code Monkey logo

Comments (17)

dscape avatar dscape commented on June 14, 2024

Sounds like a winner to me
On Nov 4, 2011 11:49 PM, "Derek Perez" <
[email protected]>
wrote:

Verbose mode can be incredibly useful for debugging even in production,
instead of just throwing console.log all over the place, we could allow the
caller to specify their own custom function for capturing the logs, if a
user provides a transport, always pipe to it, otherwise if you're in
testing mode, just have that function be console.log

Thoughts?


Reply to this email directly or view it on GitHub:
#35

from nano.

 avatar commented on June 14, 2024

I guess you mean something like https://github.com/indexzero/winston?

from nano.

dscape avatar dscape commented on June 14, 2024

I think so too, I'de be very interested in this feature.

Adding @pgte and @indexzero for possible input.

@perezd do you have some code doing this? Please keep nano in a single file
as eventually I will migrate translate the library into the client side too.

On Sat, Nov 5, 2011 at 4:59 PM, tarantoga <
[email protected]>wrote:

I guess you mean something like https://github.com/indexzero/winston?


Reply to this email directly or view it on GitHub:
#35 (comment)

from nano.

pgte avatar pgte commented on June 14, 2024

I usually provide a .verbose() function that accepts a function that will accept one string arg, so you can do stuff like .verbose(console.log).
Also, I think you should provide this at the db level, not higher.

from nano.

perezd avatar perezd commented on June 14, 2024

I've not added any code yet, wanted to start a discussion on the API, first. Definitely will keep it to one file, I estimate less than 15 lines of code :P

from nano.

indexzero avatar indexzero commented on June 14, 2024

I'm still pulling for a cradle rewrite, but I'd be happy to help where I can. A small request: comma-first makes me die a little inside

from nano.

perezd avatar perezd commented on June 14, 2024

as a former cradle user, I far prefer this API, personally. Not sure how they are related?

from nano.

indexzero avatar indexzero commented on June 14, 2024

Just a question of using my constrained resources on two couchdb libraries

from nano.

perezd avatar perezd commented on June 14, 2024

I'm happy to work on this project, I feel like its a pretty simplistic change, and something I personally need.

from nano.

dscape avatar dscape commented on June 14, 2024

@perezd go for it :) looking forward to the commits. right now im checking all my public libs work on node 0.6.0 so might see some action on nano soon.

@indexzero comma first was just to help developers make less mistakes. Personally I always jshint the code anyway.

@perezd maybe a sample with winston integration would be a nice goal :) also we should be trying for 1.0 but I'm waiting on a stand alone ajax implementation to be available since I want nano in the browser to be independent from jQuery. Thoughts? Yogurt? (I'm having yogurt)

from nano.

perezd avatar perezd commented on June 14, 2024

the most basic implementation that I'd like to give is piping to STDOUT/console.log, from there, anyone should be able to take it and run with it. Its on my short list of things to do!

from nano.

dscape avatar dscape commented on June 14, 2024

Update, we actually need this to solve #36 cause tap hijacks stdout

from nano.

perezd avatar perezd commented on June 14, 2024

excellent timing :) I'm not available to work on this particular issue right this moment (closing in on a milestone for day job), but my idea was to simply add a function call to every location that we're using console.log currently, and have that execute a function that is passed into the options hash of the nano constructor, if it exists, else, assign console.log to that option, if nothing is provided, and the NANO_ENV == "testing". If we're not in testing mode, and no capture function is specified, it can be piped to an empty function.

from nano.

dscape avatar dscape commented on June 14, 2024

@perezd check travis, im super excited about having this work and knowing if something is broken. this is SUPER COOL

from nano.

perezd avatar perezd commented on June 14, 2024

its pretty rad! awesome find!

from nano.

dscape avatar dscape commented on June 14, 2024

I've started working on this in the browser branch. Was something that just needed to be done. Feedback is welcome, bonus point for showing me I'm an idiot and there's a better way to do it

from nano.

dscape avatar dscape commented on June 14, 2024

More discussion here:
https://gist.github.com/d9eb8b0046fe7e29f526

from nano.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.