Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.014 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'architect': 0.03; 'handler': 0.04; 'received:localnet': 0.07; 'content- type:multipart/signed': 0.09; 'filename:fname piece:signature': 0.09; 'developer': 0.12; 'skip:f 30': 0.13; 'bangalore,': 0.16; 'content-type:application/pgp-signature': 0.16; 'filename:fname piece:asc': 0.16; 'filename:fname:signature.asc': 0.16; 'flush()': 0.16; 'subject:lock': 0.16; '(or': 0.22; 'library.': 0.24; 'cloud': 0.28; "i'm": 0.28; 'sends': 0.29; 'confused': 0.30; 'header:User-Agent:1': 0.33; 'to:addr:python-list': 0.35; 'received:209.85.160': 0.36; 'charset:us-ascii': 0.37; 'received:google.com': 0.37; 'using': 0.37; 'received:209.85': 0.38; 'think': 0.38; 'should': 0.38; 'received:209.85.160.46': 0.39; 'received:mail-pw0-f46.google.com': 0.39; 'received:209': 0.39; 'to:addr:python.org': 0.40; 'emails': 0.60; 'header:Received:6': 0.61; 'custom': 0.61; 'simple': 0.61; 'skip:+ 10': 0.64; 'received:111': 0.84; 'yusuf': 0.84; 'quota': 0.96 Received-SPF: pass (google.com: domain of fayaz.yusuf.khan@gmail.com designates 10.68.212.73 as permitted sender) client-ip=10.68.212.73; Authentication-Results: mr.google.com; spf=pass (google.com: domain of fayaz.yusuf.khan@gmail.com designates 10.68.212.73 as permitted sender) smtp.mail=fayaz.yusuf.khan@gmail.com; dkim=pass header.i=fayaz.yusuf.khan@gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:user-agent:mime-version :content-type:content-transfer-encoding; bh=ZhptFyyTrMHj4Vd7f+jm385Mc/UE27Ix73pwDkbvTDc=; b=nS4h5ruwulQFdobXVCDobg3yw+fHd9njlZ9D73qZ5kiFv7dcSbvt58zsCT2ugWtWmv SA2D+zAir6Up4Y42c9qNqZ3n6y6lr/7zCn+dEAEAx6P0908BEIz8MLvbkspayGCZjm7a FxA9PXciaVnRpmp+fnkp9RIZgb2eeC8xXkvxQ= From: Fayaz Yusuf Khan To: python-list@python.org Subject: Should I acquire lock for logging.Handler.flush()? Date: Tue, 21 Feb 2012 12:53:37 +0530 User-Agent: KMail/4.7.3 (Linux/3.0.0-16-generic; KDE/4.7.4; i686; ; ) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1928838.FMpIDk21BN"; micalg="pgp-sha1"; protocol="application/pgp-signature" Content-Transfer-Encoding: 7Bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 38 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1329809252 news.xs4all.nl 6906 [2001:888:2000:d::a6]:48335 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:20659 --nextPart1928838.FMpIDk21BN Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" I'm writing a custom logging Handler that sends emails through AWS Simple Email Service using the boto library. As there's a quota cap on how many (200) emails I can send within 24hrs, I think I need to buffer my log messages from the emit() calls (Or is that a bad idea?). And I was reading the Handler documentation and was confused if I should call the acquire() and release() methods from within a flush() call. -- Fayaz Yusuf Khan Cloud developer and architect Dexetra SS, Bangalore, India fayaz.yusuf.khan_AT_gmail_DOT_com fayaz_AT_dexetra_DOT_com +91-9746-830-823 --nextPart1928838.FMpIDk21BN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAABAgAGBQJPQ0Z5AAoJEFp5PFlEQdURTJ4H+wcneCDLQqDEh8yQnyYDlUbZ ZX5L6Z65+rtZNYwiRDeS56KgRpsalBO2AB+oPJRVklgztAVuW5hHUO98eky3a0NJ g5mCC/311jUupZA+sQ89eEH0vwPuwqqyYS2QUqbQTzDBWtidQGpmtevBJBh3LDvs OLZyglit98lw35a/vB4C8PRTeynI332AfVEsUSMIFl9UPaJB9bWPmmENEdAxfGRi 2Sb7It5oLHiPRCWXIdCnKZ4t2exlp2j7tySayWSdUNxvbQzLVcfkM1EQCINCyh9j yYxT7bPV3NTCXbY8qTGhw6xHCt8/pwho+ovisR+LLWI4scL15rZ7J/9VZ1VJBYY= =xECD -----END PGP SIGNATURE----- --nextPart1928838.FMpIDk21BN--