Skip to content

Commit

Permalink
Switch to go stdlib structured logging (slog)
Browse files Browse the repository at this point in the history
  • Loading branch information
pgundlach committed Aug 27, 2023
1 parent 6c5bef1 commit 814c259
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion core/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package core

import (
"fmt"
"log/slog"
"os"
"strconv"
"strings"

"golang.org/x/exp/slog"
"golang.org/x/net/html"

pdf "github.com/speedata/baseline-pdf"
Expand Down
3 changes: 1 addition & 2 deletions core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ package core
import (
"fmt"
"io"
"log/slog"
"os"
"regexp"
"strconv"
"strings"

"golang.org/x/exp/slog"

"github.com/speedata/boxesandglue/backend/bag"
"github.com/speedata/boxesandglue/backend/document"
"github.com/speedata/boxesandglue/backend/node"
Expand Down
2 changes: 1 addition & 1 deletion core/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package core

import (
"fmt"
"log/slog"
"reflect"
"strconv"
"strings"

"golang.org/x/exp/slog"
"golang.org/x/net/html"

"github.com/speedata/bagme/document"
Expand Down
2 changes: 1 addition & 1 deletion core/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"encoding/base64"
"encoding/hex"
"fmt"
"log/slog"
"math"
"os"
"regexp"
Expand All @@ -21,7 +22,6 @@ import (
"github.com/yuin/goldmark"
highlighting "github.com/yuin/goldmark-highlighting"
"github.com/yuin/goldmark/extension"
"golang.org/x/exp/slog"
)

const fnNS = "urn:speedata.de/2021/xtsfunctions/en"
Expand Down
2 changes: 1 addition & 1 deletion core/grid.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package core

import (
"fmt"
"log/slog"
"math"
"strings"

"github.com/speedata/boxesandglue/backend/bag"
"golang.org/x/exp/slog"
)

type area struct {
Expand Down
3 changes: 1 addition & 2 deletions core/io.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ package core
import (
"fmt"
"io/fs"
"log/slog"
"os"
"path/filepath"
"strings"

"golang.org/x/exp/slog"
)

var filelist = make(map[string]string)
Expand Down
2 changes: 1 addition & 1 deletion core/page.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package core

import (
"fmt"
"log/slog"

"github.com/speedata/boxesandglue/backend/bag"
"github.com/speedata/boxesandglue/backend/document"
"github.com/speedata/boxesandglue/backend/node"
"github.com/speedata/boxesandglue/frontend"
"github.com/speedata/goxml"
"golang.org/x/exp/slog"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/speedata/xts

go 1.20
go 1.21

require (
github.com/alecthomas/chroma v0.10.0
Expand Down
2 changes: 1 addition & 1 deletion xts/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"fmt"
"io"
"log/slog"
"net/http"
"os"
"os/exec"
Expand All @@ -14,7 +15,6 @@ import (
"github.com/speedata/xts/xts/luacsv"
"github.com/speedata/xts/xts/luaxlsx"
"github.com/speedata/xts/xts/luaxml"
"golang.org/x/exp/slog"

"github.com/cjoudrey/gluahttp"
lua "github.com/yuin/gopher-lua"
Expand Down
2 changes: 1 addition & 1 deletion xts/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (
"encoding/xml"
"fmt"
"io"
"log/slog"
"os"
"strings"

"github.com/speedata/xts/core"
"golang.org/x/exp/slog"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion xts/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"io"
"io/ioutil"
"log/slog"
"os"
"os/exec"
"path/filepath"
Expand All @@ -17,7 +18,6 @@ import (
"github.com/speedata/optionparser"
"github.com/speedata/textlayout/fonts/truetype"
"github.com/speedata/xts/core"
"golang.org/x/exp/slog"
)

var (
Expand Down

0 comments on commit 814c259

Please sign in to comment.