From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.204.70.74 with SMTP id c10cs30434bkj; Tue, 19 Oct 2010 11:35:08 -0700 (PDT) Received: by 10.151.49.1 with SMTP id b1mr9539283ybk.338.1287513307702; Tue, 19 Oct 2010 11:35:07 -0700 (PDT) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id u4si1216802ybi.99.2010.10.19.11.35.07; Tue, 19 Oct 2010 11:35:07 -0700 (PDT) Received-SPF: pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-talk-bounces@rubyforge.org; dkim=neutral (body hash did not verify) header.i=@gmail.com Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 1D03219783CE; Tue, 19 Oct 2010 14:35:07 -0400 (EDT) Received: from mail-pv0-f178.google.com (mail-pv0-f178.google.com [74.125.83.178]) by rubyforge.org (Postfix) with ESMTP id 54F3E1858361 for ; Tue, 19 Oct 2010 14:18:30 -0400 (EDT) Received: by pvg12 with SMTP id 12so590800pvg.23 for ; Tue, 19 Oct 2010 11:18:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=3rp55DI0uh8Nm4DtqzlT4k/6EAwM5yNGc3zt0DWk3bk=; b=GeORdhnm3L9ILJC3VPK1bG1lW7yMlobL1jZCWagCYfN1lrRNcZR/92sDv2UYy2hMtE kn+Xm0n3CsfSe/y7q01OBq+MfZqzS5aNl81zf8oCu+n4tQ4gezQVUHnSvKfc4FnUu0M4 LAC4dAODWrCkmg1b+zPvZqgi8sAjJEr7TD6W8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=vxhw+kzpkVe/VWrPpQIU4n4gnYPlrXqHroCUl3K8JXsb/7Pw85pZBy+28DHKdA83uL HG7A359e4vzKXUx6g5tPk6WhEieRD1yDQCcDBt95O5kI8N5ZkaRWRhyfut+P8gmPXNW1 gJ9bGCiaVlNKtP+CeT1mWMBOWwzwdemvfPPLA= MIME-Version: 1.0 Received: by 10.229.181.12 with SMTP id bw12mr5416536qcb.249.1287512309262; Tue, 19 Oct 2010 11:18:29 -0700 (PDT) Received: by 10.229.231.141 with HTTP; Tue, 19 Oct 2010 11:18:29 -0700 (PDT) In-Reply-To: <1287479408-sup-4846@blake> References: <1287479408-sup-4846@blake> Date: Tue, 19 Oct 2010 19:18:29 +0100 Message-ID: From: Hamish D To: Shadowfirebird Cc: sup-talk Subject: Re: [sup-talk] Hints on debugging hooks X-BeenThere: sup-talk@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: User & developer discussion of Sup List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-talk-bounces@rubyforge.org Errors-To: sup-talk-bounces@rubyforge.org > Can someone give me some hints on debugging hooks? For example, is there an easy way to get just one message object in the console, so I can play with it? For hooks, I tried using debug. So in the before-add-message hook you could have: debug ("message subject is #{message.subj} and is from #{message.from.email}") Then launch sup with debug on: $ SUP_LOG_LEVEL=debug sup And you will get extra logging, including your hook debug message, in the log buffer (press ; to see the buffer list). One thing to watch out for in the message hooks is that the regex is case sensitive by default. To change that, just put an i at the end, eg if message.subj =~ /\[sup-talk\]/i message.add_label "sup" end Good luck Hamish _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk