Merge lp:~jamesodhunt/snappy/log-filename+lineno-onlyh-for-loglevel-error-and-above into lp:~snappy-dev/snappy/snappy-moved-to-github
Proposed by
James Hunt
on 2015-03-27
| Status: | Merged |
|---|---|
| Approved by: | Michael Vogt on 2015-03-30 |
| Approved revision: | 270 |
| Merged at revision: | 285 |
| Proposed branch: | lp:~jamesodhunt/snappy/log-filename+lineno-onlyh-for-loglevel-error-and-above |
| Merge into: | lp:~snappy-dev/snappy/snappy-moved-to-github |
| Diff against target: |
116 lines (+54/-19) 2 files modified
logger/logger.go (+5/-0) logger/logger_test.go (+49/-19) |
| To merge this branch: | bzr merge lp:~jamesodhunt/snappy/log-filename+lineno-onlyh-for-loglevel-error-and-above |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| John Lenton | 2015-03-27 | Approve on 2015-03-30 | |
|
Review via email:
|
|||
Commit Message
Don't include filename+line number unless logging levels ERROR and above.
Description of the Change
Logging the filename+line number for every log entry is overkill unless the level is ERROR or higher:
* logger/logger.go: Format(): Don't include filename+line number unless
logging levels ERROR and above.
* logger/
- Assert new log format behaviour.
- TestWrite(): Now tests all log levels.
- TestFormat(): Now tests all log levels.
To post a comment you must log in.


Nice.
Shame loggo doesn't give you a way to not compute line numbers when not needed (as it's relatively expensive).