Skip to content
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 · 2 comments · Fixed by #5365
Closed

Make the "filename error log format" configurable #5352

bep opened this issue Oct 24, 2018 · 2 comments · Fixed by #5365

Comments

@bep
Copy link
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
Copy link
Contributor

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
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
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
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
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 as completed in #5365 Oct 27, 2018
bep added a commit that referenced this issue Oct 27, 2018
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
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants