Message389549
Vinay would you consider a patch for logging where dictConfig allows taking objects directly in addition to the reference id?
That would allow the following:
```
def noErrorLogs(param):
return 1 if param.levelno < 40 else 0
logconfig_dict = {
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "DEBUG",
"stream": "ext://sys.stdout",
"filters": [noErrorLogs]
}
},
"root": {"level": "DEBUG", "handlers": ["console"]},
"version": 1,
}
dictConfig(logconfig_dict)
```
or alternatively passing them on declaration:
```
logconfig_dict = {
'filters': {
'myfilter': noErrorLogs,
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "DEBUG",
"stream": "ext://sys.stdout",
"filters": ["myfilter"]
}
},
"root": {"level": "DEBUG", "handlers": ["console"]},
"version": 1,
}
dictConfig(logconfig_dict)
```
I'm happy to put a patch together if that looks good to you. |
|
Date |
User |
Action |
Args |
2021-03-26 13:59:35 | mariocj89 | set | recipients:
+ mariocj89, vinay.sajip, lorb, raybb |
2021-03-26 13:59:35 | mariocj89 | set | messageid: <1616767175.47.0.333265682754.issue41906@roundup.psfhosted.org> |
2021-03-26 13:59:35 | mariocj89 | link | issue41906 messages |
2021-03-26 13:59:35 | mariocj89 | create | |
|