common/herrors: Make the file error log format configurable
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 27 Oct 2018 15:19:36 +0000 (17:19 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 27 Oct 2018 17:14:16 +0000 (19:14 +0200)
commit1ad117cbe2903aa9d029f90750acf633eb2a51a2
treeca799c24dec061ed90095be0ba81a2513fdcc464
parentdac7092a9cb22d59db28fb15af15f7b14ff47588
common/herrors: Make the file error log format configurable

Will check for an OS environment variable named `HUGO_FILE_LOG_FORMAT`.

The tokens available are `:file` (absolute filename), `:line` (line number) and `:col` (column number).

The default format is: \":file::line::col\"`

How to set OS environment variables is OS specific, but an example on Unix setting an alternative format when running Hugo:

```bash
env HUGO_FILE_LOG_FORMAT="\":file::line\"" hugo
```

The above will include filename and line number quoted.

Fixes #5352
common/herrors/error_locator.go
common/herrors/error_locator_test.go