Skip to content

Commit

Permalink
更新日志组件
Browse files Browse the repository at this point in the history
  • Loading branch information
rroy233 committed Sep 21, 2023
1 parent 2149d8e commit ef79e3f
Show file tree
Hide file tree
Showing 21 changed files with 27 additions and 46 deletions.
2 changes: 1 addition & 1 deletion db/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/rroy233/StickerDownloader/config"
"github.com/rroy233/StickerDownloader/statistics"
"github.com/rroy233/StickerDownloader/utils"
"github.com/rroy233/logger"
"gopkg.in/rroy233/logger.v2"
"os"
"strings"
"time"
Expand Down
2 changes: 1 addition & 1 deletion db/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/go-redis/redis/v8"
"github.com/rroy233/StickerDownloader/config"
"github.com/rroy233/StickerDownloader/languages"
"github.com/rroy233/logger"
"gopkg.in/rroy233/logger.v2"
)

// var db *sqlx.DB
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ require (
github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
golang.org/x/sys v0.4.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
golang.org/x/sys v0.10.0 // indirect
gopkg.in/rroy233/logger.v2 v2.0.1 // indirect
)
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ github.com/rroy233/logger v1.1.2 h1:VpRVCf50qnwtZsSWJxDFE+iiBvuYN6zla6jher9sAeI=
github.com/rroy233/logger v1.1.2/go.mod h1:0CJ4dfE/+wGffshyYFFVm20lUu1pigic/gcsCe/SfFY=
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
Expand All @@ -38,9 +40,13 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781 h1:DzZ89McO9/gWPsQXS/FVKAlG0
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18=
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/rroy233/logger.v2 v2.0.1 h1:BmiKTwwxjwUj+ZSrbpBo4i46Fo89Jj/fMEGNSOi53xw=
gopkg.in/rroy233/logger.v2 v2.0.1/go.mod h1:N7PuXYxiRrZr9MT2GzMYoEuFQCZyH+AA+Ov0nPBB7r4=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Expand Down
2 changes: 1 addition & 1 deletion handler/AddStickerUrlMessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/rroy233/StickerDownloader/config"
"github.com/rroy233/StickerDownloader/languages"
"github.com/rroy233/StickerDownloader/utils"
"github.com/rroy233/logger"
"gopkg.in/rroy233/logger.v2"
)

var addStickersUrlPrefix = "https://t.me/addstickers/"
Expand Down
3 changes: 1 addition & 2 deletions handler/AnimationMessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/rroy233/StickerDownloader/config"
"github.com/rroy233/StickerDownloader/languages"
"github.com/rroy233/StickerDownloader/utils"
"github.com/rroy233/logger"
"gopkg.in/rroy233/logger.v2"
"time"
)

Expand Down Expand Up @@ -87,6 +87,5 @@ func AnimationMessage(update tgbotapi.Update) {
logger.Error.Println(userInfo+"failed to delete msg:", err)
}

utils.RemoveFile(outPath)
return
}
2 changes: 1 addition & 1 deletion handler/AutoLeave.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package handler
import (
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
"github.com/rroy233/StickerDownloader/utils"
"github.com/rroy233/logger"
"gopkg.in/rroy233/logger.v2"
)

func AutoLeave(update tgbotapi.Update) {
Expand Down
2 changes: 1 addition & 1 deletion handler/DownloadStickerSetQuery.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/rroy233/StickerDownloader/languages"
"github.com/rroy233/StickerDownloader/statistics"
"github.com/rroy233/StickerDownloader/utils"
"github.com/rroy233/logger"
"gopkg.in/rroy233/logger.v2"
"os"
"sync/atomic"
"time"
Expand Down
2 changes: 1 addition & 1 deletion handler/QuitQueueQuery.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"github.com/rroy233/StickerDownloader/db"
"github.com/rroy233/StickerDownloader/languages"
"github.com/rroy233/StickerDownloader/utils"
"github.com/rroy233/logger"
"gopkg.in/rroy233/logger.v2"
)

func QuitQueueQuery(update tgbotapi.Update) {
Expand Down
2 changes: 1 addition & 1 deletion handler/StickersMessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/rroy233/StickerDownloader/languages"
"github.com/rroy233/StickerDownloader/statistics"
"github.com/rroy233/StickerDownloader/utils"
"github.com/rroy233/logger"
"gopkg.in/rroy233/logger.v2"
"time"
)

Expand Down
2 changes: 1 addition & 1 deletion handler/queue_op.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/rroy233/StickerDownloader/db"
"github.com/rroy233/StickerDownloader/languages"
"github.com/rroy233/StickerDownloader/utils"
"github.com/rroy233/logger"
"gopkg.in/rroy233/logger.v2"
"time"
)

Expand Down
2 changes: 1 addition & 1 deletion languages/language.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
"github.com/rroy233/StickerDownloader/config"
"github.com/rroy233/logger"
"gopkg.in/rroy233/logger.v2"
"os"
"strings"
)
Expand Down
3 changes: 1 addition & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/rroy233/StickerDownloader/router"
"github.com/rroy233/StickerDownloader/statistics"
"github.com/rroy233/StickerDownloader/utils"
"github.com/rroy233/logger"
"gopkg.in/rroy233/logger.v2"
"os"
"os/signal"
"syscall"
Expand All @@ -37,7 +37,6 @@ func main() {
RequestUrl: config.Get().Logger.ReportUrl,
QueryKey: config.Get().Logger.ReportQueryKey,
},
NotUseJson: true,
})

//language
Expand Down
2 changes: 1 addition & 1 deletion router/handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/rroy233/StickerDownloader/languages"
"github.com/rroy233/StickerDownloader/statistics"
"github.com/rroy233/StickerDownloader/utils"
"github.com/rroy233/logger"
"gopkg.in/rroy233/logger.v2"
"strings"
"time"
)
Expand Down
2 changes: 1 addition & 1 deletion statistics/statistics.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/json"
"fmt"
"github.com/go-redis/redis/v8"
"github.com/rroy233/logger"
"gopkg.in/rroy233/logger.v2"
"sync"
"sync/atomic"
"time"
Expand Down
2 changes: 1 addition & 1 deletion utils/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
"github.com/rroy233/StickerDownloader/statistics"
"github.com/rroy233/logger"
"gopkg.in/rroy233/logger.v2"
"io/ioutil"
"log"
"math/rand"
Expand Down
2 changes: 1 addition & 1 deletion utils/ffmpeg.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package utils
import (
"context"
"fmt"
"github.com/rroy233/logger"
"gopkg.in/rroy233/logger.v2"
"os/exec"
"runtime"
"strings"
Expand Down
2 changes: 1 addition & 1 deletion utils/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"crypto/md5"
"fmt"
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
"github.com/rroy233/logger"
"gopkg.in/rroy233/logger.v2"
"io"
"os"
"strings"
Expand Down
24 changes: 0 additions & 24 deletions utils/file_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion utils/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package utils
import (
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
"github.com/rroy233/StickerDownloader/languages"
"github.com/rroy233/logger"
"go.uber.org/ratelimit"
"gopkg.in/rroy233/logger.v2"
"os"
"strings"
"time"
Expand Down
2 changes: 1 addition & 1 deletion utils/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package utils

import (
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
"github.com/rroy233/logger"
"gopkg.in/rroy233/logger.v2"
"time"
)

Expand Down

0 comments on commit ef79e3f

Please sign in to comment.