SetFormatter sets the default formatter for all new backends. A backend will fetch this value once it is needed to format a record. Note that backends will cache the formatter after the first point. For now, make sure to set the formatter before logging.
(f Formatter)
| 130 | // will cache the formatter after the first point. For now, make sure to set |
| 131 | // the formatter before logging. |
| 132 | func SetFormatter(f Formatter) { |
| 133 | formatter.Lock() |
| 134 | defer formatter.Unlock() |
| 135 | formatter.def = f |
| 136 | } |
| 137 | |
| 138 | var formatRe = regexp.MustCompile(`%{([a-z]+)(?::(.*?[^\\]))?}`) |
| 139 |
no outgoing calls