Skip to content

Commit

Permalink
Move entirely to zerolog (#426)
Browse files Browse the repository at this point in the history
Completely switch to zerolog

(Remove usage of logrus and std logger)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
  • Loading branch information
jolheiser and 6543 committed Oct 12, 2021
1 parent 9c85c8f commit 4276a04
Show file tree
Hide file tree
Showing 160 changed files with 4,980 additions and 395 deletions.
5 changes: 2 additions & 3 deletions agent/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@ import (
"sync"
"time"

"github.com/rs/zerolog/log"
"github.com/tevino/abool"
"google.golang.org/grpc/metadata"

"github.com/woodpecker-ci/woodpecker/pipeline"
"github.com/woodpecker-ci/woodpecker/pipeline/backend"
"github.com/woodpecker-ci/woodpecker/pipeline/multipart"
"github.com/woodpecker-ci/woodpecker/pipeline/rpc"

"github.com/rs/zerolog/log"
"github.com/tevino/abool"
)

// TODO: Implement log streaming.
Expand Down
1 change: 1 addition & 0 deletions cli/build/build_approve.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"strconv"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/internal"
)

Expand Down
1 change: 1 addition & 0 deletions cli/build/build_decline.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"strconv"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/internal"
)

Expand Down
1 change: 1 addition & 0 deletions cli/build/build_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"text/template"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/internal"
)

Expand Down
1 change: 1 addition & 0 deletions cli/build/build_kill.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"strconv"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/internal"
)

Expand Down
1 change: 1 addition & 0 deletions cli/build/build_last.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"text/template"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/internal"
)

Expand Down
1 change: 1 addition & 0 deletions cli/build/build_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"text/template"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/internal"
)

Expand Down
1 change: 1 addition & 0 deletions cli/build/build_ps.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"text/template"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/internal"
)

Expand Down
1 change: 1 addition & 0 deletions cli/build/build_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"text/template"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/internal"
)

Expand Down
1 change: 1 addition & 0 deletions cli/build/build_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"strconv"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/internal"
)

Expand Down
1 change: 1 addition & 0 deletions cli/build/build_stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"strconv"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/internal"
)

Expand Down
4 changes: 2 additions & 2 deletions cli/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"os"
"strconv"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/internal"
"github.com/woodpecker-ci/woodpecker/woodpecker-go/woodpecker"

"github.com/urfave/cli"
)

// Command exports the deploy command.
Expand Down
8 changes: 4 additions & 4 deletions cli/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ import (
"fmt"
"io"
"io/ioutil"
"log"
"path"
"path/filepath"
"runtime"
"strings"

"github.com/drone/envsubst"
"github.com/rs/zerolog/log"
"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/pipeline"
"github.com/woodpecker-ci/woodpecker/pipeline/backend"
"github.com/woodpecker-ci/woodpecker/pipeline/backend/docker"
Expand All @@ -22,8 +24,6 @@ import (
"github.com/woodpecker-ci/woodpecker/pipeline/frontend/yaml/matrix"
"github.com/woodpecker-ci/woodpecker/pipeline/interrupt"
"github.com/woodpecker-ci/woodpecker/pipeline/multipart"

"github.com/urfave/cli"
)

// Command exports the exec command.
Expand All @@ -33,7 +33,7 @@ var Command = cli.Command{
ArgsUsage: "[path/to/.woodpecker.yml]",
Action: func(c *cli.Context) {
if err := exec(c); err != nil {
log.Fatalln(err)
log.Fatal().Err(err).Msg("")
}
},
Flags: flags,
Expand Down
1 change: 1 addition & 0 deletions cli/lint/lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"strings"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/pipeline/schema"
)

Expand Down
1 change: 1 addition & 0 deletions cli/log/log_purge.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"strconv"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/internal"
)

Expand Down
4 changes: 2 additions & 2 deletions cli/registry/registry_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"io/ioutil"
"strings"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/internal"
"github.com/woodpecker-ci/woodpecker/woodpecker-go/woodpecker"

"github.com/urfave/cli"
)

var registryCreateCmd = cli.Command{
Expand Down
4 changes: 2 additions & 2 deletions cli/registry/registry_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"html/template"
"os"

"github.com/woodpecker-ci/woodpecker/cli/internal"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/internal"
)

var registryInfoCmd = cli.Command{
Expand Down
4 changes: 2 additions & 2 deletions cli/registry/registry_rm.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package registry

import (
"github.com/woodpecker-ci/woodpecker/cli/internal"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/internal"
)

var registryDeleteCmd = cli.Command{
Expand Down
4 changes: 2 additions & 2 deletions cli/registry/registry_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"io/ioutil"
"strings"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/internal"
"github.com/woodpecker-ci/woodpecker/woodpecker-go/woodpecker"

"github.com/urfave/cli"
)

var registryUpdateCmd = cli.Command{
Expand Down
1 change: 1 addition & 0 deletions cli/repo/repo_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/internal"
)

Expand Down
1 change: 1 addition & 0 deletions cli/repo/repo_chown.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/internal"
)

Expand Down
1 change: 1 addition & 0 deletions cli/repo/repo_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"text/template"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/internal"
)

Expand Down
1 change: 1 addition & 0 deletions cli/repo/repo_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"text/template"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/internal"
)

Expand Down
1 change: 1 addition & 0 deletions cli/repo/repo_repair.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package repo

import (
"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/internal"
)

Expand Down
4 changes: 2 additions & 2 deletions cli/repo/repo_rm.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package repo
import (
"fmt"

"github.com/woodpecker-ci/woodpecker/cli/internal"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/internal"
)

var repoRemoveCmd = cli.Command{
Expand Down
1 change: 1 addition & 0 deletions cli/repo/repo_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"text/template"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/internal"
)

Expand Down
4 changes: 2 additions & 2 deletions cli/repo/repo_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"fmt"
"time"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/internal"
"github.com/woodpecker-ci/woodpecker/woodpecker-go/woodpecker"

"github.com/urfave/cli"
)

var repoUpdateCmd = cli.Command{
Expand Down
4 changes: 2 additions & 2 deletions cli/secret/secret_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"io/ioutil"
"strings"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/internal"
"github.com/woodpecker-ci/woodpecker/woodpecker-go/woodpecker"

"github.com/urfave/cli"
)

var secretCreateCmd = cli.Command{
Expand Down
4 changes: 2 additions & 2 deletions cli/secret/secret_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"io/ioutil"
"strings"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/internal"
"github.com/woodpecker-ci/woodpecker/woodpecker-go/woodpecker"

"github.com/urfave/cli"
)

var secretUpdateCmd = cli.Command{
Expand Down
2 changes: 1 addition & 1 deletion cli/user/user_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"

"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/woodpecker-go/woodpecker"

"github.com/woodpecker-ci/woodpecker/cli/internal"
"github.com/woodpecker-ci/woodpecker/woodpecker-go/woodpecker"
)

var userAddCmd = cli.Command{
Expand Down
14 changes: 6 additions & 8 deletions cmd/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,19 @@ import (
"os"
"sync"

grpccredentials "google.golang.org/grpc/credentials"

"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/tevino/abool"
"github.com/urfave/cli"
oldcontext "golang.org/x/net/context"
"google.golang.org/grpc"
grpccredentials "google.golang.org/grpc/credentials"
"google.golang.org/grpc/keepalive"
"google.golang.org/grpc/metadata"

"github.com/woodpecker-ci/woodpecker/agent"
"github.com/woodpecker-ci/woodpecker/pipeline/backend/docker"
"github.com/woodpecker-ci/woodpecker/pipeline/rpc"

"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/tevino/abool"
"github.com/urfave/cli"
oldcontext "golang.org/x/net/context"
)

func loop(c *cli.Context) error {
Expand Down
1 change: 1 addition & 0 deletions cmd/agent/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"net/http"

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/agent"
"github.com/woodpecker-ci/woodpecker/version"
)
Expand Down
4 changes: 2 additions & 2 deletions cmd/agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import (
"fmt"
"os"

"github.com/woodpecker-ci/woodpecker/version"

_ "github.com/joho/godotenv/autoload"
"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/version"
)

func main() {
Expand Down
6 changes: 3 additions & 3 deletions cmd/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ import (
"fmt"
"os"

_ "github.com/joho/godotenv/autoload"
"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/build"
"github.com/woodpecker-ci/woodpecker/cli/deploy"
"github.com/woodpecker-ci/woodpecker/cli/exec"
Expand All @@ -29,9 +32,6 @@ import (
"github.com/woodpecker-ci/woodpecker/cli/secret"
"github.com/woodpecker-ci/woodpecker/cli/user"
"github.com/woodpecker-ci/woodpecker/version"

_ "github.com/joho/godotenv/autoload"
"github.com/urfave/cli"
)

func main() {
Expand Down
Loading

0 comments on commit 4276a04

Please sign in to comment.