vendor/zasync/1.1

changeset 37:e70bf02ce6dd 1.1-nux 1.1.0-1.1-nux

Modified to not log 'formdata', if formdata is big binary data this will preserve space. One can still see 'formdata' in ZMI if "Display formdata in Plugin Arguments of 'Calls' tab" is checked in Properties tab.
author rspivak
date Thu, 22 Feb 2007 15:33:46 +0000
parents 025ee8ba2d50
children ccf80502e52c
files CHANGES client/zasync/client.py client/zasync/plugins.py
diffstat 3 files changed, 23 insertions(+), 3 deletions(-) [+]
line diff
     1.1 --- a/CHANGES
     1.2 +++ b/CHANGES
     1.3 @@ -9,4 +9,7 @@
     1.4  -
     1.5  New internal features:
     1.6  ~~~~~~~~~~~~~~~~~~~~~~
     1.7 --
     1.8 +- Modified to not log 'formdata', if formdata is big binary data this will
     1.9 +  preserve space. One can still see 'formdata' in ZMI if
    1.10 +  "Display formdata in Plugin Arguments of 'Calls' tab" is checked in
    1.11 +  Properties tab.
     2.1 --- a/client/zasync/client.py
     2.2 +++ b/client/zasync/client.py
     2.3 @@ -294,8 +294,17 @@
     2.4                          zopeDeferred.__of__(tool).errback(
     2.5                              failure.Failure(KeyError(name)))
     2.6                          continue
     2.7 +                    # RS: Data stored in formdata may be big binary, so we
     2.8 +                    # exclude it from logging
     2.9 +                    #log.debug('got call for plugin %s (args %r; kwargs %r)',
    2.10 +                    #          name, args, kwargs)
    2.11 +                    log_args = list(args)
    2.12 +                    # remove 'formdata' which is at index 1
    2.13 +                    del log_args[1]
    2.14 +                    log_args = tuple(log_args)
    2.15                      log.debug('got call for plugin %s (args %r; kwargs %r)',
    2.16 -                              name, args, kwargs)
    2.17 +                              name, log_args, kwargs)
    2.18 +
    2.19                      zopeDeferredId = zopeDeferred.key
    2.20                      timeout = zopeDeferred.timeout
    2.21                      calltimeout = call_info['timeout']
     3.1 --- a/client/zasync/plugins.py
     3.2 +++ b/client/zasync/plugins.py
     3.3 @@ -364,9 +364,17 @@
     3.4  
     3.5  def put_call(call, bucket):
     3.6      logger = logging.getLogger('zasync.plugins')
     3.7 +    # RS: formdat may big binary, that's why we don't log it
     3.8 +    # formdata is at index 2 in call
     3.9 +    #logger.debug(
    3.10 +    #    'zope_exec: putting call %r in queue for bucket (homepath) %r',
    3.11 +    #    call, bucket)
    3.12 +    log_call = list(call)
    3.13 +    del log_call[2]
    3.14 +    log_call = tuple(log_call)
    3.15      logger.debug(
    3.16          'zope_exec: putting call %r in queue for bucket (homepath) %r',
    3.17 -        call, bucket)
    3.18 +        log_call, bucket)
    3.19      taskQueue.put(call, bucket=bucket) # this must be after all of the work in
    3.20      # zope_exec, above, or else the data structures the worker thread expects
    3.21      # are not (necessarily) in place yet.  This is in a separate reactor call