Inductiveload created this task.
Inductiveload added a project: Pywikibot.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION
  When printing output, if the log level is INFO or above, the output is logged 
twice:
  
    #! /usr/bin/env python3
    
    import pywikibot
    import logging
    
    pywikibot.output("Normal output")
    
    logger = logging.getLogger('pywiki')
    logger.setLevel(logging.INFO)
    
    # set for other logging purposes
    logging.basicConfig(level=logging.WARNING)
    
    pywikibot.output("Double output")
    
    logger.setLevel(logging.WARNING)
    
    pywikibot.output("No output")
  
  Produces
  
    Normal output
    Double output
    INFO:pywiki:Double output
  
  The upshot of this is that it seems impossible to use the Python `logging` 
module at all without causing either double logging (which gets very verbose 
when outputting something like a diff), or no logging at all, if the log level 
is higher than INFO.
  
  It would be helpful if:
  
  - The double logging can be avoided, and also
  - Output can be retained even if the log level is > INFO. For example, I 
might not want INFO level log spew, but I still want to see things printed by, 
say, `showDiff`.

TASK DETAIL
  https://phabricator.wikimedia.org/T281643

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Inductiveload
Cc: Aklapper, pywikibot-bugs-list, Inductiveload, Shalomori123, Jyoo1011, 
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, 
Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, jayvdb, Masti, 
Alchimista
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to