|
| 1 | +import logging |
| 2 | + |
| 3 | +# this bit just included to make this file runable |
| 4 | +logging.basicConfig(level=logging.DEBUG) |
| 5 | + |
| 6 | +password = "<pass>" |
| 7 | +msg = "foo %s" |
| 8 | + |
| 9 | +LOGGER = logging.getLogger("LOGGER") |
| 10 | + |
| 11 | +logging.info(msg, password) # $ MISSING: loggingInput=msg loggingInput=password |
| 12 | +logging.info(msg="hello") # $ MISSING: loggingInput="hello" |
| 13 | + |
| 14 | +logging.log(logging.INFO, msg, password) # $ MISSING: loggingInput=msg loggingInput=password |
| 15 | +LOGGER.log(logging.INFO, msg, password) # $ MISSING: loggingInput=msg loggingInput=password |
| 16 | + |
| 17 | +logging.root.info(msg, password) # $ MISSING: loggingInput=msg loggingInput=password |
| 18 | + |
| 19 | +# test of all levels |
| 20 | + |
| 21 | +logging.critical(msg, password) # $ MISSING: loggingInput=msg loggingInput=password |
| 22 | +logging.fatal(msg, password) # $ MISSING: loggingInput=msg loggingInput=password |
| 23 | +logging.error(msg, password) # $ MISSING: loggingInput=msg loggingInput=password |
| 24 | +logging.warning(msg, password) # $ MISSING: loggingInput=msg loggingInput=password |
| 25 | +logging.warn(msg, password) # $ MISSING: loggingInput=msg loggingInput=password |
| 26 | +logging.info(msg, password) # $ MISSING: loggingInput=msg loggingInput=password |
| 27 | +logging.debug(msg, password) # $ MISSING: loggingInput=msg loggingInput=password |
| 28 | +logging.exception(msg, password) # $ MISSING: loggingInput=msg loggingInput=password |
| 29 | + |
| 30 | +LOGGER.critical(msg, password) # $ MISSING: loggingInput=msg loggingInput=password |
| 31 | +LOGGER.fatal(msg, password) # $ MISSING: loggingInput=msg loggingInput=password |
| 32 | +LOGGER.error(msg, password) # $ MISSING: loggingInput=msg loggingInput=password |
| 33 | +LOGGER.warning(msg, password) # $ MISSING: loggingInput=msg loggingInput=password |
| 34 | +LOGGER.warn(msg, password) # $ MISSING: loggingInput=msg loggingInput=password |
| 35 | +LOGGER.info(msg, password) # $ MISSING: loggingInput=msg loggingInput=password |
| 36 | +LOGGER.debug(msg, password) # $ MISSING: loggingInput=msg loggingInput=password |
| 37 | +LOGGER.exception(msg, password) # $ MISSING: loggingInput=msg loggingInput=password |
| 38 | + |
| 39 | +# not sure how to make these print anything, but just to show that it works |
| 40 | +logging.Logger("foo").info("hello") # $ MISSING: loggingInput="hello" |
| 41 | + |
| 42 | +class MyLogger(logging.Logger): |
| 43 | + pass |
| 44 | + |
| 45 | +MyLogger("bar").info("hello") # $ MISSING: loggingInput="hello" |
0 commit comments