Use logrus.
This commit is contained in:
@ -1,16 +1,15 @@
|
||||
package deliver
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/RichardKnop/machinery/v1"
|
||||
"github.com/RichardKnop/machinery/v1/log"
|
||||
"github.com/go-redis/redis"
|
||||
uuid "github.com/satori/go.uuid"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/yukimochi/Activity-Relay/models"
|
||||
)
|
||||
|
||||
@ -68,7 +67,7 @@ func Entrypoint(g *models.RelayConfig, v string) error {
|
||||
worker := machineryServer.NewWorker(workerID.String(), globalConfig.JobConcurrency())
|
||||
err = worker.Launch()
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
logrus.Error(err)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
@ -11,6 +11,7 @@ import (
|
||||
"time"
|
||||
|
||||
httpdate "github.com/Songmu/go-httpdate"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/yukimochi/httpsig"
|
||||
)
|
||||
|
||||
@ -44,7 +45,7 @@ func sendActivity(inboxURL string, KeyID string, body []byte, publicKey *rsa.Pri
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
fmt.Println(inboxURL, resp.StatusCode)
|
||||
logrus.Debug(inboxURL, resp.StatusCode)
|
||||
if resp.StatusCode/100 != 2 {
|
||||
return errors.New("Post " + inboxURL + ": " + resp.Status)
|
||||
}
|
||||
|
Reference in New Issue
Block a user