Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0CFC0463E for ; Wed, 11 May 2011 14:52:04 +0000 (UTC) Received: (qmail 3363 invoked by uid 500); 11 May 2011 14:52:03 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 3323 invoked by uid 500); 11 May 2011 14:52:03 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 3315 invoked by uid 99); 11 May 2011 14:52:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 May 2011 14:52:03 +0000 X-ASF-Spam-Status: No, hits=1.8 required=5.0 tests=FREEMAIL_FROM,FREEMAIL_REPLY,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of paul.joseph.davis@gmail.com designates 209.85.220.180 as permitted sender) Received: from [209.85.220.180] (HELO mail-vx0-f180.google.com) (209.85.220.180) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 May 2011 14:51:57 +0000 Received: by vxk12 with SMTP id 12so566168vxk.11 for ; Wed, 11 May 2011 07:51:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type:content-transfer-encoding; bh=qfsNQ4DvgXTc0wHpwLsdA10hqAZSkHrCSz+u9VG9m8s=; b=UonIKjQ5dp+qjK+BsFKcUy79Omm/9WiBZYndjWz+t4DLw5wzljoXqLjx0toGemk9UE Tod53CscDbbuh8MlUUGr2G57PEfxKc0J3dAODM+qtQ05t9+NLeuG971/Pyi2OXqY/ICl pZXTAG7TA8axKW7YXKVUnveZiqVOCsdJERPlM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=b7Nne7VzIAA50MdeP8W4N5SJYpNx6uHJ2QmF0eukMKQdlbpTEQaII016VTzBKb2HJP MTa0JbgEk9wLw595LEs9KX16rNHH1Za9zCOh3DQ9d2EsU/YOhw9eiMBlZZP20sFOfVEp kfzhiBpFlDSg+wJ4QMt7H5+J9y4zDNRv+AeW8= Received: by 10.52.111.10 with SMTP id ie10mr196435vdb.81.1305125496073; Wed, 11 May 2011 07:51:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.101.166 with HTTP; Wed, 11 May 2011 07:50:56 -0700 (PDT) In-Reply-To: References: <20110511142622.09D852388A29@eris.apache.org> From: Paul Davis Date: Wed, 11 May 2011 10:50:56 -0400 Message-ID: Subject: Re: svn commit: r1101896 - /couchdb/trunk/src/couchdb/couch_log.erl To: dev@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable That should be fine I think. Theoretically the only thing getting through before was non-unicode stuff which should pass through unicode:characters_to_binary just fine, right? On Wed, May 11, 2011 at 10:27 AM, Filipe David Manana wrote: > If no one has an objection, I would apply this to 1.1.x as well, since > it suffers the same issue. > > On Wed, May 11, 2011 at 3:26 PM, =A0 wrote: >> Author: fdmanana >> Date: Wed May 11 14:26:21 2011 >> New Revision: 1101896 >> >> URL: http://svn.apache.org/viewvc?rev=3D1101896&view=3Drev >> Log: >> Fix logger crash when messages have unicode characters >> >> This closes COUCHDB-1158. Thanks Dale Harvey. >> >> Modified: >> =A0 =A0couchdb/trunk/src/couchdb/couch_log.erl >> >> Modified: couchdb/trunk/src/couchdb/couch_log.erl >> URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_log.er= l?rev=3D1101896&r1=3D1101895&r2=3D1101896&view=3Ddiff >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- couchdb/trunk/src/couchdb/couch_log.erl (original) >> +++ couchdb/trunk/src/couchdb/couch_log.erl Wed May 11 14:26:21 2011 >> @@ -167,10 +167,10 @@ log(#state{fd =3D Fd}, ConsoleMsg, FileMsg >> =A0 =A0 ok =3D io:put_chars(Fd, FileMsg). >> >> =A0get_log_messages(Pid, Level, Format, Args) -> >> - =A0 =A0ConsoleMsg =3D io_lib:format( >> - =A0 =A0 =A0 =A0"[~s] [~p] " ++ Format ++ "~n", [Level, Pid | Args]), >> + =A0 =A0ConsoleMsg =3D unicode:characters_to_binary(io_lib:format( >> + =A0 =A0 =A0 =A0"[~s] [~p] " ++ Format ++ "~n", [Level, Pid | Args])), >> =A0 =A0 FileMsg =3D ["[", httpd_util:rfc1123_date(), "] ", ConsoleMsg], >> - =A0 =A0{iolist_to_binary(ConsoleMsg), iolist_to_binary(FileMsg)}. >> + =A0 =A0{ConsoleMsg, iolist_to_binary(FileMsg)}. >> >> =A0read(Bytes, Offset) -> >> =A0 =A0 LogFileName =3D couch_config:get("log", "file"), >> >> >> > > > > -- > Filipe David Manana, > fdmanana@gmail.com, fdmanana@apache.org > > "Reasonable men adapt themselves to the world. > =A0Unreasonable men adapt the world to themselves. > =A0That's why all progress depends on unreasonable men." >