File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 44 "encoding/json"
55 "fmt"
66 "net/http"
7- "os"
87
98 "github.com/spf13/pflag"
9+ "k8s.io/klog/v2"
1010
1111 "github.com/diamondlightsource/dra-usbip-driver/pkg/devicemetadata"
1212 "github.com/diamondlightsource/dra-usbip-driver/pkg/kmod"
@@ -42,10 +42,10 @@ func listDevices(w http.ResponseWriter, req *http.Request) {
4242 if err != nil {
4343 // Log but don't error - need to continue on to
4444 // return list of other devices.
45- fmt . Printf ("Failed to bind device %s: %v \n " , device , err )
45+ klog . Errorf ("Failed to bind device %s: %s " , device , err )
4646 continue
4747 }
48- fmt . Printf ("Bound device %s\n " , device )
48+ klog . Infof ("Bound device %s" , device )
4949 }
5050
5151 devicesMetadata = append (devicesMetadata , udevInfo )
@@ -66,12 +66,10 @@ func main() {
6666
6767 moduleLoaded , err := kmod .IsLoaded ("usbip_host" )
6868 if err != nil {
69- fmt .Println ("Unable to check kernel modules: %s" , err )
70- os .Exit (1 )
69+ klog .Fatalf ("Unable to check kernel modules: %s" , err )
7170 }
7271 if ! moduleLoaded {
73- fmt .Println ("usbip_host kernel module is not loaded" )
74- os .Exit (1 )
72+ klog .Fatal ("usbip_host kernel module is not loaded" )
7573 }
7674
7775 mux := http .NewServeMux ()
You can’t perform that action at this time.
0 commit comments