Personal computing discussed

Moderators: SecretSquirrel, just brew it!

 
Crayon Shin Chan
Silver subscriber
Minister of Gerbil Affairs
Topic Author
Posts: 2302
Joined: Fri Sep 06, 2002 11:14 am
Location: Malaysia
Contact:

Can't get Sinatra (ruby) to shut up

Mon Aug 31, 2015 4:54 am

I've tried this:
require 'sinatra'
set :logging, false
get '/alphabet' do
   "b"
end


But whenever I make a HTTP request, I still see this in my console:
localhost - - [31/Aug/2015:11:51:54 CEST] "GET /alphabet HTTP/1.1" 200 1
- -> /alphabet


What gives?
Mothership: Thuban 1055T@3.7GHz, 12GB DDR3, M5A99X EVO, GTX470+Icy Vision Rev.2@840/3800, Vertex 2E 60GB
Supply ship: Sargas@2.8GHz, 12GB DDR3, M4A88TD-V EVO/USB3
Corsair: Macbook Air Ivy Bridge
 
just brew it!
Gold subscriber
Administrator
Posts: 51055
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Can't get Sinatra (ruby) to shut up

Mon Aug 31, 2015 5:31 am

Try moving the "set :logging, false" line inside the "do"?

(Just a wild-ass guess, I've never programmed in Ruby before...)
Nostalgia isn't what it used to be.
 
Crayon Shin Chan
Silver subscriber
Minister of Gerbil Affairs
Topic Author
Posts: 2302
Joined: Fri Sep 06, 2002 11:14 am
Location: Malaysia
Contact:

Re: Can't get Sinatra (ruby) to shut up

Mon Aug 31, 2015 5:35 am

That just gives an error message. I've also tried setting logging to nil... didn't work either.
undefined method `set' for #<Sinatra::Application:0x007fb3c9420908>
Mothership: Thuban 1055T@3.7GHz, 12GB DDR3, M5A99X EVO, GTX470+Icy Vision Rev.2@840/3800, Vertex 2E 60GB
Supply ship: Sargas@2.8GHz, 12GB DDR3, M4A88TD-V EVO/USB3
Corsair: Macbook Air Ivy Bridge
 
just brew it!
Gold subscriber
Administrator
Posts: 51055
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Can't get Sinatra (ruby) to shut up

Mon Aug 31, 2015 5:50 am

Does the setting have any effect at all? I.e., is the output different if you don't set it at all, or if you set it to true?
Nostalgia isn't what it used to be.
 
Crayon Shin Chan
Silver subscriber
Minister of Gerbil Affairs
Topic Author
Posts: 2302
Joined: Fri Sep 06, 2002 11:14 am
Location: Malaysia
Contact:

Re: Can't get Sinatra (ruby) to shut up

Mon Aug 31, 2015 6:02 am

It doesn't have any effect at all, but it's the only option I see in the Sinatra documentation that might have anything to do with it.
Mothership: Thuban 1055T@3.7GHz, 12GB DDR3, M5A99X EVO, GTX470+Icy Vision Rev.2@840/3800, Vertex 2E 60GB
Supply ship: Sargas@2.8GHz, 12GB DDR3, M4A88TD-V EVO/USB3
Corsair: Macbook Air Ivy Bridge
 
Crayon Shin Chan
Silver subscriber
Minister of Gerbil Affairs
Topic Author
Posts: 2302
Joined: Fri Sep 06, 2002 11:14 am
Location: Malaysia
Contact:

Re: Can't get Sinatra (ruby) to shut up

Mon Aug 31, 2015 8:55 am

It looks like if the web handler was WEBrick, then set :logging, false has no effect - but with Thin, it works.
Mothership: Thuban 1055T@3.7GHz, 12GB DDR3, M5A99X EVO, GTX470+Icy Vision Rev.2@840/3800, Vertex 2E 60GB
Supply ship: Sargas@2.8GHz, 12GB DDR3, M4A88TD-V EVO/USB3
Corsair: Macbook Air Ivy Bridge

Who is online

Users browsing this forum: No registered users and 6 guests