-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Windows paths not supported by default file sink #621
Comments
yes, in windows |
I have pull a request in #624 |
The reason |
I did try that and ran into the same issue listed here: golang/go#13276 With backslashes: With forward slashes: |
@prashantv , if use
because,
it will panic in https://github.com/uber-go/zap/blob/master/sink.go#L130
|
That makes sense, thanks. It looks like it has to be 3 slashes, and is covered here: Is there any other examples of Go libraries that parse Windows file URIs? |
Any update on this one, i'm running into this issue right now on windows |
I just had the same problem. Might need to look into dimrocs pr and add those changes manually. |
smartcontractkit/chainlink#977 copy logger_unix and _windows. Call the the registerOSSinks method to register the sink and you're good to go. |
+1 |
+1, it still didn't work |
Dear maintainers, 3 years later this issue is still open and is breaking logging in https://github.com/open-telemetry/opentelemetry-collector Is there any workaround yet that does not involve source changes? (which is not possible because we use otelcol release) PR #624 was unfortunately never finished. |
@Mario-Hofstaetter My feeling is that is that some mix of filepath.ToSlash/FromSlash will help solve this (I made an attempt in #999 last year), but the edit-test-debug loop was slow enough that I stopped trying. |
This is a prefactor for Windows support (uber-go#621). `TestOpen` currently relies on a hardcoded error "no such file or directory" if a file is not found. However, this error message is OS-specific. We can now rely on `errors.Is(err, fs.ErrNotExist)` if we wrap errors using `%w` instead of `%v`.
This is a prefactor for Windows support (#621). TestOpen currently relies on a hardcoded error "no such file or directory" if a file is not found. However, this error message is OS-specific. We can now rely on `errors.Is(err, fs.ErrNotExist)` if we wrap errors using %w instead of %v. Co-authored-by: Abhinav Gupta <mail@abhinavg.net>
I understand that this issue is low-priority since you never use Windows at work. Golang is shipped with cross-platform ability, this issue really make users exhausted. |
funny, my zap logger is breaking on windows and i guess this is why. Is the below still the recommended fix?
|
When using absolute Windows paths, url.Parse does not retreieve the "file" scheme.
panic: couldn't open sink "C:\\Users\\...\\AppData\\Roaming\\...\\info.log.json": no sink found for scheme "c"
Appending, "file:///" (golang/go#6027 (comment)) does not work as expected. (Ref: golang/go#13276 )
zap/sink.go
Line 99 in ff33455
Ref: golang/go#13276 (comment)
Changed by PR: #606
Temporary workaround:
The text was updated successfully, but these errors were encountered: