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

EntryCaller output path is too long or too short #1457

Open
zlx2019 opened this issue Aug 7, 2024 · 4 comments
Open

EntryCaller output path is too long or too short #1457

zlx2019 opened this issue Aug 7, 2024 · 4 comments

Comments

@zlx2019
Copy link

zlx2019 commented Aug 7, 2024

Is it possible to make the EntryCaller output path relative to the project?
Wrong example:
D:/xxx/xxx/app/app.go:46
app/app.go:46

What I want is this:
<project_root>/cmd/app/app.go:46
<project_root>/.../internal/server/server.go:46

@zlx2019
Copy link
Author

zlx2019 commented Aug 7, 2024

Does this help IDEA link jump to where the output log is

@r-hang
Copy link
Contributor

r-hang commented Aug 27, 2024

Hey @zlx2019, could you clarify what you mean by project root and how it could be calculated by zap? Is the benefit of this suggestion to help with IDE integration?

@zlx2019
Copy link
Author

zlx2019 commented Aug 28, 2024

Hey @zlx2019, could you clarify what you mean by project root and how it could be calculated by zap? Is the benefit of this suggestion to help with IDE integration?

Enter the relative path of the log source file to the project, which will help you click the link in GoLand to jump to the output.

@r-hang
Copy link
Contributor

r-hang commented Sep 17, 2024

How do we know what the project root is? Is that based on the the IDE? If that's the case, I don't believe it's best to encode IDE specific details into Zap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants