You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by Jason Smith <jh...@apache.org> on 2013/02/05 11:15:47 UTC

Please review console.log() branch

I want to merge this: https://github.com/apache/couchdb/commits/console_log

Please comment if you have a moment. It is two changes.

## console.log()

In addition to good old log(), there is console.log(). It behaves exactly
like Node.js. It supports a format string and variable arguments.

    console.log("doc id is %s and count is %d", doc._id, doc.count)
    console.dir("doc = %j", doc) // JSON format
    console.log("Full request\n%s", util.inspect(req))
    return {
      body: util.format("<title>%s</title", title)
    }
    // etc.

## Separate log file for JavaScript

_config/log/view_file = "js.log"

If this is set, every log() or console.log() will additionally go to this
file. There are no timestamps, no formatting. It is like a console.

I was thinking of adding /_log support, cleaning it up, and then merging it
in.

Re: Please review console.log() branch

Posted by Jan Lehnardt <ja...@apache.org>.
Looking good.

I’d say s/view/query/ and get that sorted.

Also, we need entries in NOTICE for the components you import.

Best
Jan
-- 

On Feb 5, 2013, at 11:15 , Jason Smith <jh...@apache.org> wrote:

> I want to merge this: https://github.com/apache/couchdb/commits/console_log
> 
> Please comment if you have a moment. It is two changes.
> 
> ## console.log()
> 
> In addition to good old log(), there is console.log(). It behaves exactly
> like Node.js. It supports a format string and variable arguments.
> 
>    console.log("doc id is %s and count is %d", doc._id, doc.count)
>    console.dir("doc = %j", doc) // JSON format
>    console.log("Full request\n%s", util.inspect(req))
>    return {
>      body: util.format("<title>%s</title", title)
>    }
>    // etc.
> 
> ## Separate log file for JavaScript
> 
> _config/log/view_file = "js.log"
> 
> If this is set, every log() or console.log() will additionally go to this
> file. There are no timestamps, no formatting. It is like a console.
> 
> I was thinking of adding /_log support, cleaning it up, and then merging it
> in.


Re: Please review console.log() branch

Posted by Jan Lehnardt <ja...@apache.org>.
On Feb 5, 2013, at 12:38 , Jason Smith <jh...@iriscouch.com> wrote:

> It used to be called "js_file" however it is properly the result of the
> ["log", "..."] command from the view server.
> 
> How about "views_log_file"?

the view server’s real name is query_server.

So maybe query_server_log?

> 
> 
> 
> On Tue, Feb 5, 2013 at 11:13 AM, Robert Newson <rn...@apache.org> wrote:
> 
>> "view_file" is an awkward name, won't output from shows, lists, etc,
>> also land here?
>> 
>> On 5 February 2013 10:15, Jason Smith <jh...@apache.org> wrote:
>>> I want to merge this:
>> https://github.com/apache/couchdb/commits/console_log
>>> 
>>> Please comment if you have a moment. It is two changes.
>>> 
>>> ## console.log()
>>> 
>>> In addition to good old log(), there is console.log(). It behaves exactly
>>> like Node.js. It supports a format string and variable arguments.
>>> 
>>>    console.log("doc id is %s and count is %d", doc._id, doc.count)
>>>    console.dir("doc = %j", doc) // JSON format
>>>    console.log("Full request\n%s", util.inspect(req))
>>>    return {
>>>      body: util.format("<title>%s</title", title)
>>>    }
>>>    // etc.
>>> 
>>> ## Separate log file for JavaScript
>>> 
>>> _config/log/view_file = "js.log"
>>> 
>>> If this is set, every log() or console.log() will additionally go to this
>>> file. There are no timestamps, no formatting. It is like a console.
>>> 
>>> I was thinking of adding /_log support, cleaning it up, and then merging
>> it
>>> in.
>> 
> 
> 
> 
> -- 
> Iris Couch


Re: Please review console.log() branch

Posted by Alexander Shorin <kx...@gmail.com>.
Hi Jason!

Why not query_server.log ? However, this command is also available for
externals and os_daemons, so probably even this name may be confused.

--
,,,^..^,,,


On Tue, Feb 5, 2013 at 3:38 PM, Jason Smith <jh...@iriscouch.com> wrote:
> It used to be called "js_file" however it is properly the result of the
> ["log", "..."] command from the view server.
>
> How about "views_log_file"?
>
>
>
> On Tue, Feb 5, 2013 at 11:13 AM, Robert Newson <rn...@apache.org> wrote:
>
>> "view_file" is an awkward name, won't output from shows, lists, etc,
>> also land here?
>>
>> On 5 February 2013 10:15, Jason Smith <jh...@apache.org> wrote:
>> > I want to merge this:
>> https://github.com/apache/couchdb/commits/console_log
>> >
>> > Please comment if you have a moment. It is two changes.
>> >
>> > ## console.log()
>> >
>> > In addition to good old log(), there is console.log(). It behaves exactly
>> > like Node.js. It supports a format string and variable arguments.
>> >
>> >     console.log("doc id is %s and count is %d", doc._id, doc.count)
>> >     console.dir("doc = %j", doc) // JSON format
>> >     console.log("Full request\n%s", util.inspect(req))
>> >     return {
>> >       body: util.format("<title>%s</title", title)
>> >     }
>> >     // etc.
>> >
>> > ## Separate log file for JavaScript
>> >
>> > _config/log/view_file = "js.log"
>> >
>> > If this is set, every log() or console.log() will additionally go to this
>> > file. There are no timestamps, no formatting. It is like a console.
>> >
>> > I was thinking of adding /_log support, cleaning it up, and then merging
>> it
>> > in.
>>
>
>
>
> --
> Iris Couch

Re: Please review console.log() branch

Posted by Jason Smith <jh...@iriscouch.com>.
It used to be called "js_file" however it is properly the result of the
["log", "..."] command from the view server.

How about "views_log_file"?



On Tue, Feb 5, 2013 at 11:13 AM, Robert Newson <rn...@apache.org> wrote:

> "view_file" is an awkward name, won't output from shows, lists, etc,
> also land here?
>
> On 5 February 2013 10:15, Jason Smith <jh...@apache.org> wrote:
> > I want to merge this:
> https://github.com/apache/couchdb/commits/console_log
> >
> > Please comment if you have a moment. It is two changes.
> >
> > ## console.log()
> >
> > In addition to good old log(), there is console.log(). It behaves exactly
> > like Node.js. It supports a format string and variable arguments.
> >
> >     console.log("doc id is %s and count is %d", doc._id, doc.count)
> >     console.dir("doc = %j", doc) // JSON format
> >     console.log("Full request\n%s", util.inspect(req))
> >     return {
> >       body: util.format("<title>%s</title", title)
> >     }
> >     // etc.
> >
> > ## Separate log file for JavaScript
> >
> > _config/log/view_file = "js.log"
> >
> > If this is set, every log() or console.log() will additionally go to this
> > file. There are no timestamps, no formatting. It is like a console.
> >
> > I was thinking of adding /_log support, cleaning it up, and then merging
> it
> > in.
>



-- 
Iris Couch

Re: Please review console.log() branch

Posted by Robert Newson <rn...@apache.org>.
"view_file" is an awkward name, won't output from shows, lists, etc,
also land here?

On 5 February 2013 10:15, Jason Smith <jh...@apache.org> wrote:
> I want to merge this: https://github.com/apache/couchdb/commits/console_log
>
> Please comment if you have a moment. It is two changes.
>
> ## console.log()
>
> In addition to good old log(), there is console.log(). It behaves exactly
> like Node.js. It supports a format string and variable arguments.
>
>     console.log("doc id is %s and count is %d", doc._id, doc.count)
>     console.dir("doc = %j", doc) // JSON format
>     console.log("Full request\n%s", util.inspect(req))
>     return {
>       body: util.format("<title>%s</title", title)
>     }
>     // etc.
>
> ## Separate log file for JavaScript
>
> _config/log/view_file = "js.log"
>
> If this is set, every log() or console.log() will additionally go to this
> file. There are no timestamps, no formatting. It is like a console.
>
> I was thinking of adding /_log support, cleaning it up, and then merging it
> in.