ANN: A new version (0.3.8) of python-gnupg has been released.

2015-09-26 Thread Vinay Sajip
signed with my code signing key: Vinay Sajip (CODE SIGNING KEY) Fingerprint: CA74 9061 914E AC13 8E66 EADB 9147 B477 339A 9B86 However, due to some error the signature for the source distribution (.tar.gz) didn't get uploaded. To rectify this, I have pasted it into the PyPI page for the rel

Re: Advise on using logging.getLogger needed.

2011-10-07 Thread Vinay Sajip
ut logger names being that they're supposed to codify "where" in your application events occur, and the package hierarchy is the canonical representation of source locations in an application. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: How add class name to format of the logging module?

2011-10-12 Thread Vinay Sajip
all was made from, you can always figure out the class. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

logging: warn() methods and function to be deprecated.

2011-10-22 Thread Vinay Sajip
nge, all the logging levels are adjectives which apply to the logged message: DEBUG, INFO, WARNING, ERROR and CRITICAL. I don't believe the WARN/warn variants were used much, if at all - but this is just a heads up for anyone who might have used them. Regards, Vinay Sajip -- http://mail.py

Re: logging: warn() methods and function to be deprecated.

2011-10-24 Thread Vinay Sajip
e removed it when 3.0 was released, but it went under my radar at that time. Hence my post here, to get feedback from logging users about this proposed change. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: logging: warn() methods and function to be deprecated.

2011-10-26 Thread Vinay Sajip
not be backported :-) As far as I know, Trac doesn't work with Python 3 anyway. Most of the code out there (which Mark found via Google Code Search) is Python 2.x. When porting from 2 to 3.3, it's just one extra little thing to deal with - small compared with other issues which come up

Re: logging: warn() methods and function to be deprecated.

2011-10-26 Thread Vinay Sajip
und a few times), and it That doesn't sound like a good usage pattern to me, especially as loggers have a log method which takes the logging level. There shouldn't be any need to pass a bound method around. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: python logging multiple processes to one file (via socket server)

2011-10-27 Thread Vinay Sajip
hough and fail to see the 'following > section'. You're right, the link got lost in a reorganisation of the documentation. Working example is here: http://docs.python.org/howto/logging-cookbook.html#sending-and-receiving-logging-events-across-a-network Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: Got some problems when using logging Filter

2011-11-19 Thread Vinay Sajip
> CRITICAL:root:whatever > > applying filter filter@a > > applying filter filter@handler > > CRITICAL:a:whatever > > applying filter fil...@a.b > > applying filter filter@handler > > CRITICAL:a.b:whatever > > $ > > > As you can infer from t

Re: Got some problems when using logging Filter

2011-11-21 Thread Vinay Sajip
s fairly painless. http://docs.python.org/library/logging.config.html#logging.config.dictConfig If you are using an earlier version of Python, the logutils project includes the same dictionary-based configuration logic. http://code.google.com/p/logutils/ Regards, Vinay Sajip -- http://mail.p

Re: Strange logging.Formatter behaviour

2011-11-22 Thread Vinay Sajip
l point in throwing a very specific exception from a formatter, as a handler isn't going to automatically know how to handle a SpecificFormatException in any meaningful way. Remember that in the general case, application developers don't always have control of what handlers are configured

Re: Peculiarity of '@' in logging.Formatter

2011-11-23 Thread Vinay Sajip
= 0 This is on Suse 11.3, where the formatting anomaly does occur - so it appears to be down to how rsyslogd does things. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: logging issues

2011-12-17 Thread Vinay Sajip
from your main() function or "if __name__ == '__main__'" suite. Until you show more detail about what you're getting and what you're expecting, it's hard to provide more help. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: Two questions about logging

2012-01-15 Thread Vinay Sajip
work on Windows). See http://docs.python.org/library/logging.handlers.html#watchedfilehandler for more information. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: python loggingL filter limitation, looks intentional?

2012-01-16 Thread Vinay Sajip
want to an instance of this handler, which you attach to your root logger. Regards, Vinay Sajip - Original Message - > From: Chris Withers > To: Vinay Sajip > Cc: Python List > Sent: Monday, 16 January 2012, 13:10 > Subject: python loggingL filter limitation, looks

Re: python loggingL filter limitation, looks intentional?

2012-01-16 Thread Vinay Sajip
ce of those individual handlers attached to the root, you simply attach your DelegatingHandler to the root logger, and attach the filter and the other handlers to that DelegatingHandler instance. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: python loggingL filter limitation, looks intentional?

2012-01-16 Thread Vinay Sajip
On Jan 16, 11:21 pm, Vinay Sajip wrote: > > I thought from an earlier comment - "rather than just the root logger where > my handlers live" - that you had your handlers attached to the root logger, > in which case it wouldn't be onerous at all. In place of those indi

Re: python logging filter limitation, looks intentional?

2012-01-17 Thread Vinay Sajip
think of these as hacks - I occasionally have to subclass stdlib classes in other areas to get the behaviour I want, and that's part and parcel of having OO at your disposal. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: python logging filter limitation, looks intentional?

2012-01-20 Thread Vinay Sajip
tly. Apart from the behavioural change, there is also a performance implication which needs to be considered. All in all, I'm not sure there is a lot of demand for this proposed change, and I have already suggested a workable approach to Chris which should meet his needs without any need for a behav

ANN: A new version (0.3.3) of the Python module which wraps GnuPG has been released.

2013-03-11 Thread Vinay Sajip
;>> str(decrypted) 'Hello, world!' >>> signed = gpg.sign("Goodbye, world!", passphrase='secret') >>> verified = gpg.verify(str(signed)) >>> print "Verified" if verified else "Not verified" 'Verified' For more information, visit http://code.google.com/p/python-gnupg/ - as always, your feedback is most welcome (especially bug reports, patches and suggestions for improvement). Enjoy! Cheers Vinay Sajip Red Dove Consultants Ltd. -- http://mail.python.org/mailman/listinfo/python-list

Re: python logging module problem

2006-07-14 Thread Vinay Sajip
reason you don't get the info messages is that you haven't set a level on the logger, so the default of WARNING is used. It's usual to rely on logger levels and to set handler levels for additional refinement of what goes to a particular handler's destination. Regards, Vin

Re: Multiple calls to logging.config.fileConfig

2006-10-07 Thread Vinay Sajip
one of a number of configurations (e.g. development, test, production) and not for incremental configuration. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: Logging with Logger hierarchies

2006-10-20 Thread Vinay Sajip
evel=logging.DEBUG, format="%(name)s: %(levelname)-5s: %(message)s") logging.getLogger("a.b.c").debug("Hello, world!") I get the output a.b.c: DEBUG: Hello, world! which is as expected. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: logging

2006-05-30 Thread Vinay Sajip
Baurzhan Ismagulov wrote: > Hello Vinay, > Ok, here is my hierarchy: > [snip] > [handlers] > keys=console [snip] > [logger_root] > level=CRITICAL > handlers=console > > [logger_l01] > level=DEBUG > qualname=l01 > handlers=console > > [logger_l02] > level=CRITICAL > qualname=l02 > handlers=console

Re: logging

2006-05-31 Thread Vinay Sajip
[EMAIL PROTECTED] wrote: > Hello Vinay, > > Hmm, log1 decides once whether to print an event, and after that it gets > printed in log1 and all its ancestors, regardless of their level? I find > this quite counter-intuitive. I'd instead expect that each logger > decides whether to print an event ac

Re: logging

2006-06-04 Thread Vinay Sajip
Hello Baurzhan, > Consider the following scenario: root is CRITICAL, l01 is DEBUG, a debug > message is logged on l01. l01 decides that the message should be > printed, and _both_ root and l01 print it. Now, it is good that the > message is propagated to root, but why doesn't root decide for itsel

Re: shared logs and multiple configurations

2006-06-09 Thread Vinay Sajip
nd the code easily enough and comment it out if you wish not to disable old loggers. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: logging magic

2006-06-14 Thread Vinay Sajip
the stack, looking for a stack frame whose corresponding source file is not the logging package itself. What is the module name/file number which gets printed? Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: Logging to a file and closing it again properly (logging module)

2006-06-14 Thread Vinay Sajip
d to close the handler - removeHandler just removes the handler from the Logger's internal list. If there are specific areas in the documentation which you feel are lacking clarity, please post more specific information. Documentation patches are especially welcome ;-) Regards, Vinay Sajip -- htt

Re: logging error with RotatingFileHandler

2006-06-27 Thread Vinay Sajip
ich is most probably an exception being thrown in os.rename. I'll look at fixing this bug asap. Most likely, it'll be done by let the exception propagate up from doRollover to its caller. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: logging error with RotatingFileHandler

2006-06-29 Thread Vinay Sajip
fileConfig("logconf.ini") So, I will investigate, and when I check in a fix to the Python Subversion repository, I will post a message to this thread. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: logging error with RotatingFileHandler

2006-07-02 Thread Vinay Sajip
ng that file open? I've fixed (AFAICT) both the crash at shutdown and the buggy exception handling, in the Python subversion repository. You can download the latest from here and try it. http://svn.python.org/view/python/trunk/Lib/logging/ Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: inheritance needed in program configuration - config module or python oo?

2006-09-04 Thread Vinay Sajip
g.html which is intended for configuring hierarchies of application components. Best regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: line duplication using logging to file

2007-01-09 Thread Vinay Sajip
onment? If you call write_log several times you will add a handler several times - this is not a normal pattern of use. You should separate setup of Loggers/Handlers/Formatters from actually logging events via debug(), info() etc. Best regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: logging module question

2006-01-25 Thread Vinay Sajip
formation to the output can be set (for a particular handler). See PEP 282 for background information on the logging scheme. You can also look at Apache logging (log4j, log4net etc.) and java.util.logging which adopt a similar approach (experience having shown that this is a good approach). Regards,

Re: Strange behavior with os call in cgi script

2006-02-07 Thread Vinay Sajip
icated. You should look at later versions of Python - your points above about easier configuration have already been addressed: here's a link from the current (2.4) docs: http://docs.python.org/lib/minimal-example.html Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: Logging hangs thread after detaching a StreamHandler's terminal

2006-02-14 Thread Vinay Sajip
at the logging module merely opens the stream passed to the StreamHander for output, so check if in your configuration you get a hang just doing a write to sys.stderr. Best regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: mod_python and logging

2005-05-16 Thread Vinay Sajip
eally don't need most of logging.*'s > facilities) are also welcome. Are you sure you'll never need them in the future? Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: RotatingFileHandler in Python 2.3.5

2005-05-16 Thread Vinay Sajip
handler is in the logging.handlers module, not in the logging module itself. If you are using a configuration file, use "handlers.RotatingFileHandler" rather than just "RotatingFileHandler". Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: logging problems

2005-05-18 Thread Vinay Sajip
You may also need to do it in config.py if you are using it. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: couple of new python articles on onlamp

2005-06-05 Thread Vinay Sajip
Jeremy Jones bellsouth.net> writes: > Python Standard Logging > http://www.onlamp.com/pub/a/python/2005/06/02/logging.html > To echo Thomas Heller's comment - nice article on logging. I'll update the docs so that the stuff about the 4-byte length is a little clearer.

Re: logging module: log file with datetime

2007-06-01 Thread Vinay Sajip
need to write a subclass of TimedRotatingFileHandler which does what you need. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: Logging: how to suppress default output when adding handlers?

2007-06-05 Thread Vinay Sajip
efore anything else happens) - or (b) Make calls on a specific named logger, e.g. logging.getLogger("logtest2").error("foo"), rather than logging.error("foo") which is for casual/unsophisticated use only. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: Logging: how to suppress default output when adding handlers?

2007-06-05 Thread Vinay Sajip
# for module foo/bar/baz.py # Near the top of the module... import logging logger = logging.getLogger("foo.bar.baz") # Then, in the rest of the module... logger.debug("Test debug output") # No more verbose than logging.debug("Test debug output") Even i

Re: open function fail after running a day

2007-06-07 Thread Vinay Sajip
a=t.read() #processing data... except: logging.exception("Failed to process file %r", filename) finally: t.close() Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: open function fail after running a day

2007-06-07 Thread Vinay Sajip
Try the following: import logging t=open(filename,'rb') try: data=t.read() #processing data... except: logging.exception("Failed to process %r", filename) finally: t.close() -- http://mail.python.org/mailman/listinfo/python-list

Re: open function fail after running a day

2007-06-07 Thread Vinay Sajip
: import logging t=open(filename,'rb') try: try: data=t.read() #processing data... except: logging.exception("Failed to process %r", filename) finally: t.close() Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Sorry for the multiple posts

2007-06-08 Thread Vinay Sajip
Sorry for the multiple posts. I kept getting network errors and it looked like the posts weren't getting through. Regards, Vinay -- http://mail.python.org/mailman/listinfo/python-list

Re: logging module and threading

2007-06-13 Thread Vinay Sajip
relays log entries from the Queue into your loggers? Or, use a SocketHandler to serialize the events over a socket, and de- mux them on the receiving end. The docs have an example: http://docs.python.org/lib/network-logging.html Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: logging anomaly

2007-06-26 Thread Vinay Sajip
s this same behaviour occur if the message is logged to a console handler? (StreamHandler with sys.stderr as the stream, which is not redirected to a file). Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: using the sysloghandler class

2007-04-19 Thread Vinay Sajip
iated. The logging package's syslog handler attempts to use UDP to communicate with the syslog daemon; are you sure your system is set up with the daemon listening on SYSLOG_UDP_PORT? If it's not, then this could explain what you are seeing. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: logging SMTPHandler and Authentication

2007-05-01 Thread Vinay Sajip
ent this functionality soon. As it's not a bugfix I can't backport it, but you will be able to patch your version when I've made the change. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: logging SMTPHandler and Authentication

2007-05-01 Thread Vinay Sajip
On May 1, 1:08 am, [EMAIL PROTECTED] wrote: > I'm new to Python, but I've been thrown into coding a pretty > complicated regression testing script. I need to email the log of the > daily test to the code owners. I thought I could use SMTPHandler for > this, but our email system requires authentic

Re: RotatingFileHandler bugs/errors and a general logging question.

2007-05-09 Thread Vinay Sajip
articular reason why you don't want to follow the suggested approach? Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: RotatingFileHandler bugs/errors and a general logging question.

2007-05-10 Thread Vinay Sajip
On May 10, 6:37 pm, [EMAIL PROTECTED] wrote: > On May 9, 12:37 am, Vinay Sajip <[EMAIL PROTECTED]> wrote: > > Our biggest concerns with the network solution is having a single > point of failure and the need for scalability. We could have > potentially thousands of machin

Re: logging module and threading

2007-05-12 Thread Vinay Sajip
developers or admins to send information about the events to different audiences - e.g. critical errors might be emailed to someone while less critical errors are sent to console or log files. Best regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: stdlib doc for logger.findCaller() needs update.

2007-05-25 Thread Vinay Sajip
e next 2.4.x release should have them. Thanks for the report. Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: stdlib doc for logger.findCaller() needs update.

2007-05-25 Thread Vinay Sajip
On May 25, 12:27 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > > Is a further 2.4 release planned? > > I'd have thought that unless a security issue appears the answer is > likely to be "no". > You never know - and it didn't take long to commit the change to release24-maint, so why not?! Regards,

Re: Extending logging module

2007-08-13 Thread Vinay Sajip
lass - but remember to call the base class's __init__ from your own __init__, if you provide one. Best regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: customizing a logging logger

2007-09-12 Thread Vinay Sajip
which may be of some help - it's a similar use case. Best regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: customizing a logging logger

2007-09-13 Thread Vinay Sajip
to avoid computation of *other* data passed to the logging call - i.e. other arguments - you should still use the logger.isXXXEnabled() idiom to avoid unnecessary computation, where performance is an issue. Best regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: strange behavious of the logging module?

2007-09-24 Thread Vinay Sajip
On Sep 24, 8:03 am, Peter Otten <[EMAIL PROTECTED]> wrote: > > It would still be a good idea to file a bug report. Not sure where the bug is. The script below, when called, prints "Information" to the console and "INFO some_func Information" to mc_rigid.log, as I would expect. (Python 2.5.1)

Re: strange behavious of the logging module?

2007-09-24 Thread Vinay Sajip
On Sep 24, 4:29 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > Vinay Sajip wrote: > > On Sep 24, 8:03 am, Peter Otten <[EMAIL PROTECTED]> wrote: > > >> It would still be a good idea to file a bug report. > > > Not sure where the bug is. The script below, wh

Re: strange behavious of the logging module?

2007-09-25 Thread Vinay Sajip
On 25 Sep, 09:40, Peter Otten <[EMAIL PROTECTED]> wrote: > You could try setting > > logging._srcfile =logging.info.func_code.co_filename > > manually, but that might break other things. Or you recreate the pyc-files > of your distribution. Again, I don't know what might break... > Recreating .pyc

Re: Overriding Logging Config FileHandler Filename

2007-09-25 Thread Vinay Sajip
o, remove one from the logger and add the other. I see you are using a rotating handler, which itself does rollover to new log files every so often. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Version 0.3.7 of the config module has been released

2007-10-05 Thread Vinay Sajip
ves The above example just scratches the surface. There's more information about this module available at http://www.red-dove.com/python_config.html Comprehensive API documentation is available at http://www.red-dove.com/config/index.html As always, your feedback is most welcome (especially

Re: python logging module and custom handler specified in config file

2007-10-18 Thread Vinay Sajip
lers = customhandlers # Bind your module to "custhandlers" in logging and then your logging configuration can refer to "custhandlers.DBHandler". Of course I merely used "custhandlers" and "customhandlers" to show how you can bind to an arbitrary name. The same technique applies to the arguments passed to the constructor. Hope this helps, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: python logging module and custom handler specified in config file

2007-10-19 Thread Vinay Sajip
On 19 Oct, 12:04, Frank Aune <[EMAIL PROTECTED]> wrote: > On Thursday 18 October 2007 19:26:59 Vinay Sajip wrote: > > What if you want to datestamp filenames for filehandlers, say with todays date > for example? > > [handler_file] > class=FileHandler > level=NO

Re: logging module - restricted mode error

2007-10-20 Thread Vinay Sajip
or example, are you running under mod_python? If so, which version? When googling, did you search for the exact text of the error message? For example, did you see the following post? http://mail-archives.apache.org/mod_mbox/httpd-python-dev/200404.mbox/[EMAIL PROTECTED] Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: logging module - restricted mode error

2007-10-21 Thread Vinay Sajip
On 21 Oct, 07:50, Paul Rudin <[EMAIL PROTECTED]> wrote: > > Can you say a little bit more about the execution environment? For > > example, are you running under mod_python? If so, which version? > > I'm not running under mod_python - but this is using cherrypy. I also > do some passing of pickled

Re: Write by logging.FileHandler to one file by many processess

2007-10-23 Thread Vinay Sajip
tHandler and a separate > listening process. The Python logging docs even contain a working example of such a listening process (receiver): http://www.python.org/doc/current/lib/network-logging.html Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: python logging config file doesn't allow filters?

2007-10-29 Thread Vinay Sajip
figuration file format, and no plans to include them in the near future (your post is the first time configuring filters has been mentioned). However, if you would like to submit a patch, I'll certainly take a look at it! Best regards, Vinay sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: selective logger disable/enable

2007-01-19 Thread Vinay Sajip
Removes the specified filter filt from this logger. The parent section of Section 14.5.1, which is Section 14.5, was the first search result when I just searched Google for "python logging". Best regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: My first try using logger didn't work. Why?

2007-01-19 Thread Vinay Sajip
n entry in the NT Event Log on my machine: import logging, logging.handlers logger = logging.getLogger("TahChung Part 1") logger.setLevel(logging.INFO) eventHandler = logging.handlers.NTEventLogHandler("TahChung") eventHandler.setLevel(logging.INFO) formatter = logging.Formatter("%(message)s") event

Re: My first try using logger didn't work. Why?

2007-01-19 Thread Vinay Sajip
exactly how your app is set up: if there's no more natural way, you could get a Logger instance and see if it has any handlers added, before creating a new one and adding it. This could be done by checking len(logger.handlers) == 0 for that logger. Best regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: selective logger disable/enable

2007-01-21 Thread Vinay Sajip
el explicitly set - the logger named "network"). If all you are interested in is turning on verbosity based on different event severities (levels), you should not need to use or set Filters. Filters are for use only when levels don't meet your use case requirements. Best regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: selective logger disable/enable

2007-01-21 Thread Vinay Sajip
andalone distribution at http://www.red-dove.com/python_logging.html (download and examine some of the test scripts). Loggers aren't binary - levels are there to be used. Most people get by with judicious use of levels, using Filters on loggers only for unusual cases. Since Filters are

Re: selective logger disable/enable

2007-01-23 Thread Vinay Sajip
Gary Jefferson wrote: > Vinay Sajip wrote: > > > > BTW I would also advise reading PEP-282 to understand more about the > > logging approach. > > > You've been most helpful, Vinay. The PEP section on Filters states > that I can do what I've been tryin

Re: TimedRotatingFileHandler() isn't rotating at midnight?

2007-02-09 Thread Vinay Sajip
ing on google and don't > see anything in the code that would prevent rotating. > Rotating should happen when the logging process creates the handler before midnight and makes a logging call destined for that handler after midnight. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: basic jython question

2007-02-18 Thread Vinay Sajip
e over an existing system such as log4j or java.util.logging would have the potential to perform better. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: TimedRotatingFileHandler() isn't rotating at midnight?

2007-02-23 Thread Vinay Sajip
of rotation by e.g. logrotate), reopens the file before writing to it. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: logging.SocketHandler connections

2007-11-16 Thread Vinay Sajip
this a bug? Not sure yet - can you please post your test server code? Feel free to add it as a bug on bugs.python.org, with the code attached, and I'll look into it. Include "logging" in the subject/summary line. Thanks, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: logging.SocketHandler connections

2007-11-19 Thread Vinay Sajip
On Nov 19, 10:27 am, oj <[EMAIL PROTECTED]> wrote: > On Nov 16, 2:31 pm, Vinay Sajip <[EMAIL PROTECTED]> wrote: > > Here is the server code. Pretty much directly copied from the example, > aside from not having the the handler loop forever, and queing the > records

Re: logging.SocketHandler connections

2007-11-20 Thread Vinay Sajip
On Nov 20, 12:08 pm, oj <[EMAIL PROTECTED]> wrote: > On Nov 19, 5:30 pm, Vinay Sajip <[EMAIL PROTECTED]> wrote: > > > > > On Nov 19, 10:27 am, oj <[EMAIL PROTECTED]> wrote: > > > > On Nov 16, 2:31 pm, Vinay Sajip <[EMAIL PROTECTED]> wrote:

Re: logging.SocketHandler connections

2007-11-20 Thread Vinay Sajip
On Nov 20, 1:47 pm, oj <[EMAIL PROTECTED]> wrote: > On Nov 20, 12:26 pm, Vinay Sajip <[EMAIL PROTECTED]> wrote: > > > > > Can you confirm that if you add the while loop back in, all messages > > are seen by the server? It worked for me. > > Yes, it works

Re: logging and propagation

2007-11-21 Thread Vinay Sajip
On Nov 21, 11:38 am, oj <[EMAIL PROTECTED]> wrote: > Hi, > > I want to setuploggingwith two loggers: > > The child logger is used when something different needs to be done > with the log record, and the log record will propagate and be logged > by the root logger as usual. > > However, there are ce

Re: logging and propagation

2007-11-22 Thread Vinay Sajip
On Nov 22, 2:34 pm, Vinay Sajip <[EMAIL PROTECTED]> wrote: > On Nov 22, 9:18 am, oj <[EMAIL PROTECTED]> wrote: > > Why not apply the same filter to the parent loggers? Of course, you can apply filters at the loggers or the handlers. The filters at the logger are checked firs

Re: logging and propagation

2007-11-22 Thread Vinay Sajip
On Nov 22, 9:18 am, oj <[EMAIL PROTECTED]> wrote: > On Nov 22, 5:44 am, Vinay Sajip <[EMAIL PROTECTED]> wrote: > > > > > On Nov 21, 11:38 am, oj <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I want to setuploggingwith two loggers: > &

Re: logging.py: mutiple system users writing to same file getting permission errors.

2007-12-07 Thread Vinay Sajip
f your choosing which has the appropriate permissions to write to the log file. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: logging.py: mutiple system users writing to same file getting permission errors.

2007-12-11 Thread Vinay Sajip
On Dec 10, 8:34 pm, evenrik <[EMAIL PROTECTED]> wrote: > On Dec 7, 12:46 pm, Vinay Sajip <[EMAIL PROTECTED]> wrote: > > > > > On Dec 6, 6:35 pm, evenrik <[EMAIL PROTECTED]> wrote: > > > > An a redhat box I have root, apache and other normal users ru

Re: logging module: add client_addr to all log records

2006-05-09 Thread Vinay Sajip
:44:57,421|french.knights.nu]: Incoming Bovine > Detected > > I'm grateful for any advice. > > Cheers! > /Joel Hedlund > See a very similar example which uses the new 'extra' keyword argument: http://docs.python.org/dev/lib/module-logging.html The example is

Re: logging

2006-05-23 Thread Vinay Sajip
lem? You've defined the handler against both the root logger and l01. You only need it configured for the root logger - events passed to l01 will be passed to all handlers up the hierarchy. So remove the "handlers=console" line from [logger_l01] and it should print the message just once. Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: logging

2006-05-25 Thread Vinay Sajip
Baurzhan Ismagulov wrote: > Thanks for the idea! I think this should work for the example I sent. > However, I have more than one module, and I want to log only l01. How > can I do that? > I don't know what your logger hierarchy looks like: you could perhaps log to child loggers of l01 ("l01.XXX

Re: "No handlers could be found for logger xxx" ?

2006-05-25 Thread Vinay Sajip
l generally filter out logging messages. Un-initialized logging chatters because in development environments, it's useful to be able to spot misconfigured loggers. For production use, set logging.raiseExceptions to 0 and logging should then be quiet. Regards, Vinay Sajip -- http://mail.python.

Passing contextual information when logging

2008-01-08 Thread Vinay Sajip
, of course, garbage collected in the normal way and so impose no particular memory burden. Best regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing contextual information when logging

2008-01-08 Thread Vinay Sajip
On 8 Jan, 09:46, Antoine Pitrou <[EMAIL PROTECTED]> wrote: > One question : why does the exception() method call Logger.error() rather than > Logger.exception() ? exception() is a convenience method which adds the keyword argument exc_info=1 to append traceback information to the log. Both excepti

Re: problem with logging exceptions with non-ASCII __str__ result

2008-01-14 Thread Vinay Sajip
be made to work > reliably on other users machines. > > One could, of course, write code to specifically check for > this condition and manually pre-convert the message string > to unicode but that seems not as things should be. > > How can I cleanly handle this situation ? > > Should theloggingmodule internally use an encoding gotten > from the locale module rather than the default string encoding ? > > Karsten > -- > GPG key ID E4071346 @ wwwkeys.pgp.net > E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346 Please reduce to a minimal program which demonstrates the issue and log an issue on bugs.python.org. Best regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: handlers.SocketHandler and exceptions

2008-01-17 Thread Vinay Sajip
the socket. """ ei = record.exc_info if ei: dummy = self.format(record) # just to get traceback text into record.exc_text record.exc_info = None # to avoid Unpickleable error s = cPickle.dumps(record.__dict__, 1) if e

Re: handlers.SocketHandler and exceptions

2008-01-17 Thread Vinay Sajip
On Jan 17, 5:50 pm, writeson <[EMAIL PROTECTED]> wrote: > Vinay, > > Thanks for your reply, very interesting. We're currently running > Python2.3 (though we are getting ready to move to Python2.5), so I'm > guessing the code you're showing comes from Python2.5? I'm wondering > if I can edit the han

Re: examples of logger using smtp

2008-01-18 Thread Vinay Sajip
nal argument ((user, password) tuple, defaulting to None) has been added. So if you are using Rob Wolfe's approach, it may be easier for you to use "credentials" because your code will not need to change when Python 2.6 appears. Best regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   >