internal/cglfw: use stderr instead of log

This commit is contained in:
Hajime Hoshi 2023-10-07 18:36:20 +09:00
parent aef7b0dd38
commit cb023af4b6

View File

@ -18,7 +18,7 @@ import "C"
import (
"fmt"
"log"
"os"
)
// ErrorCode corresponds to an error code.
@ -178,13 +178,13 @@ func acceptError(codes ...ErrorCode) error {
// package.
switch err.Code {
case platformError:
log.Println(err)
fmt.Fprintln(os.Stderr, err)
return nil
case notInitialized, noCurrentContext, invalidEnum, invalidValue, outOfMemory:
panic(err)
default:
fmt.Println("GLFW: An invalid error was not accepted by the caller:", err)
fmt.Println("GLFW: Please report this bug in the Go package immediately.")
fmt.Fprintln(os.Stderr, "GLFW: An invalid error was not accepted by the caller:", err)
fmt.Fprintln(os.Stderr, "GLFW: Please report this bug in the Go package immediately.")
panic(err)
}
}