SetBackend replaces the backend currently set with the given new logging backend.
(backends ...Backend)
| 16 | // SetBackend replaces the backend currently set with the given new logging |
| 17 | // backend. |
| 18 | func SetBackend(backends ...Backend) LeveledBackend { |
| 19 | var backend Backend |
| 20 | if len(backends) == 1 { |
| 21 | backend = backends[0] |
| 22 | } else { |
| 23 | backend = MultiLogger(backends...) |
| 24 | } |
| 25 | |
| 26 | defaultBackend = AddModuleLevel(backend) |
| 27 | return defaultBackend |
| 28 | } |
| 29 | |
| 30 | // SetLevel sets the logging level for the specified module. The module |
| 31 | // corresponds to the string specified in GetLogger. |