New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the "filename error log format" configurable #5352

Closed
bep opened this Issue Oct 24, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@bep
Member

bep commented Oct 24, 2018

See #5332

I don't think we should add an "editor config" section yet.

But we can add a OS environment variable only: HUGO_FILE_ERROR_FORMAT or something like that, where you could describe the format somehow.

@kaushalmodi

This comment has been minimized.

Member

kaushalmodi commented Oct 24, 2018

The OS env var would be fine too.

HUGO_FILE_ERROR_FORMAT or something like that, where you could describe the format somehow.

I'd suggest a name like HUGO_EDITOR_FILE_LINENUM_FORMAT, and I could hypothetically set that to "+LINE:COL FILE".

Hugo will replace LINE with line number, COL with column number, FILE with absolute file path and create a string foo, and then invoke $EDITOR foo (where EDITOR is another env var and is usually set by default on most (all?) Unix systems).

bep added a commit to bep/hugo that referenced this issue Oct 27, 2018

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 gohugoio#5352

bep added a commit to bep/hugo that referenced this issue Oct 27, 2018

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 gohugoio#5352

bep added a commit to bep/hugo that referenced this issue Oct 27, 2018

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 gohugoio#5352

bep added a commit to bep/hugo that referenced this issue Oct 27, 2018

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 gohugoio#5352

@bep bep closed this in #5365 Oct 27, 2018

bep added a commit that referenced this issue Oct 27, 2018

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment