Skip to content

Commit

Permalink
Use gitpod-io log package
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf committed Jun 10, 2021
1 parent bfe5992 commit c36bcb5
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 16 deletions.
5 changes: 5 additions & 0 deletions components/blobserve/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
package cmd

import (
"context"
"encoding/json"
"fmt"
"os"

containerd_log "github.com/containerd/containerd/log"
"github.com/spf13/cobra"

"github.com/gitpod-io/gitpod/blobserve/pkg/blobserve"
Expand All @@ -30,6 +32,9 @@ var rootCmd = &cobra.Command{
Args: cobra.MinimumNArgs(1),
PersistentPreRun: func(cmd *cobra.Command, args []string) {
log.Init(ServiceName, Version, jsonLog, jsonLog)

// configure containerd log with gitpod-io configuration
containerd_log.WithLogger(context.Background(), log.Log)
},
}

Expand Down
6 changes: 2 additions & 4 deletions components/common-go/log/redact_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
// Licensed under the GNU Affero General Public License (AGPL).
// See License-AGPL.txt in the project root for license information.

package log_test
package log

import (
"testing"

"github.com/gitpod-io/gitpod/common-go/log"
)

func TestRedactJSON(t *testing.T) {
Expand All @@ -22,7 +20,7 @@ func TestRedactJSON(t *testing.T) {
}

for i, test := range tests {
res, err := log.RedactJSON([]byte(test.Input))
res, err := RedactJSON([]byte(test.Input))
if err != nil {
t.Errorf("test %d failed: %v", i, err)
continue
Expand Down
2 changes: 1 addition & 1 deletion components/ee/ws-scheduler/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"

"github.com/gitpod-io/gitpod/common-go/log"
"github.com/gitpod-io/gitpod/common-go/pprof"
"github.com/gitpod-io/gitpod/ws-scheduler/pkg/scaler"
sched "github.com/gitpod-io/gitpod/ws-scheduler/pkg/scheduler"
Expand Down
2 changes: 1 addition & 1 deletion components/ee/ws-scheduler/pkg/scheduler/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
"sort"
"time"

log "github.com/sirupsen/logrus"
"golang.org/x/xerrors"
corev1 "k8s.io/api/core/v1"

wsk8s "github.com/gitpod-io/gitpod/common-go/kubernetes"
"github.com/gitpod-io/gitpod/common-go/log"
)

// StrategyName is the type that identifies strategies
Expand Down
2 changes: 1 addition & 1 deletion components/ws-daemon/cmd/client-init.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"context"

"github.com/alecthomas/repr"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"

"github.com/gitpod-io/gitpod/common-go/log"
csapi "github.com/gitpod-io/gitpod/content-service/api"
"github.com/gitpod-io/gitpod/ws-daemon/api"
)
Expand Down
9 changes: 5 additions & 4 deletions components/ws-manager/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ import (

"github.com/prometheus/client_golang/prometheus"

"github.com/spf13/cobra"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"

"github.com/gitpod-io/gitpod/common-go/grpc"
wsk8s "github.com/gitpod-io/gitpod/common-go/kubernetes"
"github.com/gitpod-io/gitpod/common-go/log"
"github.com/gitpod-io/gitpod/common-go/tracing"
"github.com/gitpod-io/gitpod/content-service/pkg/storage"
"github.com/gitpod-io/gitpod/ws-manager/pkg/manager"
"github.com/spf13/cobra"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
)

var (
Expand Down
3 changes: 1 addition & 2 deletions dev/poolkeeper/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ import (
"fmt"
"os"

wsk8s "github.com/gitpod-io/gitpod/common-go/kubernetes"
"github.com/spf13/cobra"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"

wsk8s "github.com/gitpod-io/gitpod/common-go/kubernetes"
"github.com/gitpod-io/gitpod/common-go/log"
"github.com/gitpod-io/gitpod/common-go/tracing"

"github.com/gitpod-io/gitpod/poolkeeper/pkg/poolkeeper"
)

Expand Down
2 changes: 1 addition & 1 deletion dev/poolkeeper/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"os/signal"
"syscall"

log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"

"github.com/gitpod-io/gitpod/common-go/log"
"github.com/gitpod-io/gitpod/poolkeeper/pkg/poolkeeper"
)

Expand Down
3 changes: 2 additions & 1 deletion install/installer/cmd/bash.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import (
"os"
"syscall"

"github.com/gitpod-io/installer/pkg/sources"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"

"github.com/gitpod-io/installer/pkg/sources"
)

// bashCmd represents the gcp command
Expand Down
3 changes: 2 additions & 1 deletion install/installer/pkg/gcp/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import (
"path/filepath"
"strings"

log "github.com/sirupsen/logrus"

"github.com/gitpod-io/installer/pkg/terraform"
"github.com/gitpod-io/installer/pkg/ui"
log "github.com/sirupsen/logrus"
)

var availableRegions = []string{
Expand Down

0 comments on commit c36bcb5

Please sign in to comment.