Get syslog facility from ENV var
()
| 116 | |
| 117 | |
| 118 | def get_syslog_facility(): |
| 119 | """Get syslog facility from ENV var""" |
| 120 | facil = os.getenv('WALE_SYSLOG_FACILITY', 'user') |
| 121 | |
| 122 | valid_facility = True |
| 123 | try: |
| 124 | facility = handlers.SysLogHandler.facility_names[facil.lower()] |
| 125 | except KeyError: |
| 126 | valid_facility = False |
| 127 | facility = handlers.SysLogHandler.LOG_USER |
| 128 | |
| 129 | return facility, valid_facility |
| 130 | |
| 131 | |
| 132 | def set_level(level): |