librelist archives

« back to archive

Logging to terminal consol

Logging to terminal consol

From:
André
Date:
2014-04-09 @ 18:56
Hi Nesta gurus,

I'm building a site with Nesta and it's really nice, however being used to
Rails and Ramaze, I tend to puts information to the log all the time. I
can't figure out how to get that working on Nesta. The Sinatra logging
information I've found has been unhelpful.

I'm looking to do something like this from app.rb

puts my_var + ' Is some variable'

or this from any .haml template

- puts 'Here is some data + ' a_var

Is that possible?

Re: [nesta] Logging to terminal consol

From:
Graham Ashton
Date:
2014-04-10 @ 16:40
On 9 Apr 2014, at 19:56, André <andre.drougge@gmail.com> wrote:

> The Sinatra logging information I've found has been unhelpful.

Hi André. We can definitely do logging (I’m surprised the Sinatra docs you
found didn’t just work).

Can you give us some more details of exactly what you tried? (i.e. please 
send code, in [e.g.] a GitHub gist)

It’d also be useful to know what web server you were running on (e.g. 
thin, unicorn, Nginx + Passenger, etc).

Cheers,
Graham

Re: [nesta] Logging to terminal consol

From:
André
Date:
2014-04-23 @ 16:23
Hi!

Part of my app.rb gist: https://gist.github.com/miphe/88f79071252d6064b201

As for the server I'm using the default which I believe is mongrel. I start
my environment like so:

shotgun config.ru

Thanks!


2014-04-10 19:40 GMT+03:00 Graham Ashton <graham@effectif.com>:

> On 9 Apr 2014, at 19:56, André <andre.drougge@gmail.com> wrote:
>
> > The Sinatra logging information I've found has been unhelpful.
>
> Hi André. We can definitely do logging (I’m surprised the Sinatra docs you
> found didn’t just work).
>
> Can you give us some more details of exactly what you tried? (i.e. please
> send code, in [e.g.] a GitHub gist)
>
> It’d also be useful to know what web server you were running on (e.g.
> thin, unicorn, Nginx + Passenger, etc).
>
> Cheers,
> Graham
>



-- 
André Drougge
Web Developer
portfolio.miphe.com

Re: [nesta] Logging to terminal consol

From:
André
Date:
2014-04-24 @ 18:48
Got it to work now.

    configure :development do
      enable :logging, :dump_errors
      set :raise_errors, true
    end

I also added require 'pp' in config.ru and I can now puts pretty output
like so:

def my_helper
  pp an_obj
end

I'm happy with this, unless your have a nicer logging technique?

Thanks!


2014-04-23 19:23 GMT+03:00 André <andre.drougge@gmail.com>:

> Hi!
>
> Part of my app.rb gist: https://gist.github.com/miphe/88f79071252d6064b201
>
> As for the server I'm using the default which I believe is mongrel. I
> start my environment like so:
>
> shotgun config.ru
>
> Thanks!
>
>
> 2014-04-10 19:40 GMT+03:00 Graham Ashton <graham@effectif.com>:
>
> On 9 Apr 2014, at 19:56, André <andre.drougge@gmail.com> wrote:
>>
>> > The Sinatra logging information I've found has been unhelpful.
>>
>> Hi André. We can definitely do logging (I’m surprised the Sinatra docs
>> you found didn’t just work).
>>
>> Can you give us some more details of exactly what you tried? (i.e. please
>> send code, in [e.g.] a GitHub gist)
>>
>> It’d also be useful to know what web server you were running on (e.g.
>> thin, unicorn, Nginx + Passenger, etc).
>>
>> Cheers,
>> Graham
>>
>
>
>
> --
> André Drougge
> Web Developer
> portfolio.miphe.com
>



-- 
André Drougge
Web Developer
portfolio.miphe.com

Re: [nesta] Logging to terminal consol

From:
Graham Ashton
Date:
2014-04-24 @ 19:03
Oh that’s good news - I was going to investigate your options and reply to
this after I’ve pushed Nesta 0.10.0 out of the door...

On 24 Apr 2014, at 19:48, André <andre.drougge@gmail.com> wrote:

> Got it to work now.
> 
>     configure :development do
>       enable :logging, :dump_errors
>       set :raise_errors, true
>     end
> 
> I also added require 'pp' in config.ru and I can now puts pretty output like so:
> 
> def my_helper
>   pp an_obj
> end
> 
> I'm happy with this, unless your have a nicer logging technique?
> 
> Thanks!
> 
> 
> 2014-04-23 19:23 GMT+03:00 André <andre.drougge@gmail.com>:
> Hi!
> 
> Part of my app.rb gist: https://gist.github.com/miphe/88f79071252d6064b201
> 
> As for the server I'm using the default which I believe is mongrel. I 
start my environment like so:
> 
> shotgun config.ru
> 
> Thanks!
> 
> 
> 2014-04-10 19:40 GMT+03:00 Graham Ashton <graham@effectif.com>:
> 
> On 9 Apr 2014, at 19:56, André <andre.drougge@gmail.com> wrote:
> 
> > The Sinatra logging information I've found has been unhelpful.
> 
> Hi André. We can definitely do logging (I’m surprised the Sinatra docs 
you found didn’t just work).
> 
> Can you give us some more details of exactly what you tried? (i.e. 
please send code, in [e.g.] a GitHub gist)
> 
> It’d also be useful to know what web server you were running on (e.g. 
thin, unicorn, Nginx + Passenger, etc).
> 
> Cheers,
> Graham
> 
> 
> 
> -- 
> André Drougge
> Web Developer
> portfolio.miphe.com
> 
> 
> 
> -- 
> André Drougge
> Web Developer
> portfolio.miphe.com

Re: [nesta] Logging to terminal consol

From:
Greg Milby
Date:
2014-04-27 @ 13:36
Good morning please remove Greg from your mailing list. He passed away on
April 10 after a short battle with cancer. Thank you.

On Wednesday, April 9, 2014, André <andre.drougge@gmail.com> wrote:

> Hi Nesta gurus,
>
> I'm building a site with Nesta and it's really nice, however being used to
> Rails and Ramaze, I tend to puts information to the log all the time. I
> can't figure out how to get that working on Nesta. The Sinatra logging
> information I've found has been unhelpful.
>
> I'm looking to do something like this from app.rb
>
> puts my_var + ' Is some variable'
>
> or this from any .haml template
>
> - puts 'Here is some data + ' a_var
>
> Is that possible?
>