From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.140.128.1 with SMTP id a1cs135266rvd; Thu, 1 Apr 2010 14:13:07 -0700 (PDT) Received-SPF: pass (google.com: domain of 3YAy1SwwICm0YZcXLWaPcdZYjSMe.YPecLNV-OPgPWRZZRWPRcZfad.NZX@groups.bounces.google.com designates 10.115.100.23 as permitted sender) client-ip=10.115.100.23; Authentication-Results: mr.google.com; spf=pass (google.com: domain of 3YAy1SwwICm0YZcXLWaPcdZYjSMe.YPecLNV-OPgPWRZZRWPRcZfad.NZX@groups.bounces.google.com designates 10.115.100.23 as permitted sender) smtp.mail=3YAy1SwwICm0YZcXLWaPcdZYjSMe.YPecLNV-OPgPWRZZRWPRcZfad.NZX@groups.bounces.google.com; dkim=pass header.i=3YAy1SwwICm0YZcXLWaPcdZYjSMe.YPecLNV-OPgPWRZZRWPRcZfad.NZX@groups.bounces.google.com Received: from mr.google.com ([10.115.100.23]) by 10.115.100.23 with SMTP id c23mr585433wam.29.1270156386437 (num_hops = 1); Thu, 01 Apr 2010 14:13:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:x-beenthere:received:received:received :received:received-spf:received:date:from:to:subject:message-id :references:mime-version:in-reply-to:user-agent :x-original-authentication-results:x-original-sender:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :x-thread-url:x-message-url:sender:list-subscribe:list-unsubscribe :content-type:content-disposition; bh=dxAJ73KrqE2XO2pJIyyqeIzAC/WZU4Z03+2oEx4Tg60=; b=LJiFB3HJRYmBxgCBBx5/r5gZu4IsLWivY53lS+QQek1VuowzHkG07BXE37KtOUeSfZ ouSyAOeVWogR9FUsM1JWGSnJqUl4N8Ri0pxQjK1EvxBCdLk+mSwsmBH0wsAsJaokA4ms n8phJU08iiLoVAHAZOxUtG08iFPhQdIrUVRxo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-beenthere:received-spf:date:from:to:subject:message-id:references :mime-version:in-reply-to:user-agent :x-original-authentication-results:x-original-sender:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :x-thread-url:x-message-url:sender:list-subscribe:list-unsubscribe :content-type:content-disposition; b=CI58PUu1zoCzVvsToW79M8tsbtzzBtHPFx1PAGr/BCCoeV4p7sfVMz8XaaItVY5nA3 tKaOGTjRJoRQasUlbjwjeEj8hF14Zs5EPJZv30tjBoQeRe3SMF2HEvKaAyPCAibcvVGB LRSIaql45yHXMKq7wnd7k3EMcoCQYAafr+4uU= Received: by 10.115.100.23 with SMTP id c23mr112077wam.29.1270156384952; Thu, 01 Apr 2010 14:13:04 -0700 (PDT) X-BeenThere: rack-devel@googlegroups.com Received: by 10.115.38.17 with SMTP id q17ls606511waj.0.p; Thu, 01 Apr 2010 14:13:02 -0700 (PDT) Received: by 10.114.18.23 with SMTP id 23mr344044war.14.1270156382595; Thu, 01 Apr 2010 14:13:02 -0700 (PDT) Received: by 10.114.18.23 with SMTP id 23mr344042war.14.1270156382550; Thu, 01 Apr 2010 14:13:02 -0700 (PDT) Return-Path: Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) by gmr-mx.google.com with ESMTP id 25si1807096pzk.0.2010.04.01.14.13.02; Thu, 01 Apr 2010 14:13:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of normalperson@yhbt.net designates 64.71.152.64 as permitted sender) client-ip=64.71.152.64; Received: from localhost (unknown [127.0.2.5]) by dcvr.yhbt.net (Postfix) with ESMTP id 287DE1F68F; Thu, 1 Apr 2010 21:13:02 +0000 (UTC) Date: Thu, 1 Apr 2010 14:13:02 -0700 From: Eric Wong To: rack-devel@googlegroups.com Subject: Re: ENV["RACK_ENV"] is not set on startup [rack/rack GH-11] Message-ID: <20100401211302.GA19563@dcvr.yhbt.net> References: <87hbnwr4pu.fsf@gmail.com> <20100401071650.GB30070@dcvr.yhbt.net> <35ED831D-F9B9-4D4C-A463-46CF62241EFE@gmail.com> MIME-Version: 1.0 In-Reply-To: <35ED831D-F9B9-4D4C-A463-46CF62241EFE@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of normalperson@yhbt.net designates 64.71.152.64 as permitted sender) smtp.mail=normalperson@yhbt.net X-Original-Sender: normalperson@yhbt.net Reply-To: rack-devel@googlegroups.com Precedence: list Mailing-list: list rack-devel@googlegroups.com; contact rack-devel+owners@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: X-Thread-Url: http://groups.google.com/group/rack-devel/t/838c8abdaae55bb8 X-Message-Url: http://groups.google.com/group/rack-devel/msg/c8a6f4b8b5b05a9e Sender: rack-devel@googlegroups.com List-Subscribe: , List-Unsubscribe: , Content-Type: text/plain; charset=ISO-8859-1 Content-Disposition: inline James Tucker wrote: > On 1 Apr 2010, at 09:21, Matt Todd wrote: > > I'm not a fan of --env/:env in general, specifically taking issue with > > implicitly modifying the middleware stack. > > > > Because of this, I'm actually quite happy with the fact that > > ENV['RACK_ENV'] isn't set when --env/:env is set. > > > > I'd much rather this feature go away and let handling environments be > > left up to the user. > > > > More specifically: > > * --env/:env should default to "development" > > * --env/:env should set ENV['RACK_ENV'] > > * --end/:env should have no other affect > > * applications/frameworks should adjust their environments according > > to ENV['RACK_ENV'] as they see fit > > > > I'm aware that this is mostly done to ease development and lower the > > barrier of entry, which I'm not opposed to doing, but I think there > > are other, better ways we can explore such as a separate > > feature/option, perhaps only in rackup, that can enable these > > middleware. > > Rackup wants a logger mostly. I'm actually wondering if rackup wants a > logger in all environments (not --envs) apart from CGI. We're never > going to please everyone on this front, but maybe we need a way for > rackup to turn off the default logger middleware separately to the > --env setting. > > --env development also has one other significantly relevant action, > and that is to add Rack::Lint to the middleware stack in order to > validate conformance to http and rack specs. I feel this should stay, > regardless of other changes. > > I propose then, that we modify the logger middleware setup to be > affected by another argument, and that --env development adds > Rack::Lint, any other --env does not modify the middleware stack at > all. Yes. Lint is special. It is important for development and should be easily toggleable between different environments. Heck, I wouldn't mind a version that adds Lint between every part of the middleware stack, even. That would of course be a pain to configure by hand. > This should be compatible with Rails envs, and also satisfy Erics > desires. We can also then deprecate the unusual "deployment" > environment which seems to be unique to rack. I prefer Matt's approach to not do any middleware changes to go with RACK_ENV (except Lint, above). Extra command-line options that try to do the same thing as editing config.ru make things more confusing than necessary. I was not happy with Rails inventing their own middleware configuration, either. If people want a request logger, they can configure Rack::CommonLogger, Clogger or whatever else in config.ru. -- Eric Wong -- To unsubscribe, reply using "remove me" as the subject.