indicar que tipo de log es
This commit is contained in:
parent
e27c98c404
commit
48f7aa40d5
3 changed files with 4 additions and 4 deletions
4
main.go
4
main.go
|
@ -37,11 +37,11 @@ func main() {
|
||||||
go func(d Domain, wg *sync.WaitGroup) {
|
go func(d Domain, wg *sync.WaitGroup) {
|
||||||
record, err := d.NameServer.SetRecord(ctx, d.Name, config.Ip)
|
record, err := d.NameServer.SetRecord(ctx, d.Name, config.Ip)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("[%s] error: %s", d.Name, err.Error())
|
log.Printf("ERROR: [%s] %s", d.Name, err.Error())
|
||||||
// TODO: Reportar errores
|
// TODO: Reportar errores
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.Printf("[%s] Set to %s", d.Name, record)
|
log.Printf("info: [%s] Set to %s", d.Name, record)
|
||||||
wg.Done()
|
wg.Done()
|
||||||
|
|
||||||
}(d, &wg)
|
}(d, &wg)
|
||||||
|
|
|
@ -39,7 +39,7 @@ func (h *HeNet) SetRecord(ctx context.Context, domain string, overrideIp string)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
log.Printf("[he.net ddns(%s)] Response: %s", domain, string(body))
|
log.Printf("debug: [he.net ddns(%s)] Response: %s", domain, string(body))
|
||||||
|
|
||||||
things := strings.Split(string(body), " ")
|
things := strings.Split(string(body), " ")
|
||||||
if len(things) != 2 {
|
if len(things) != 2 {
|
||||||
|
|
|
@ -57,7 +57,7 @@ func (n *Njalla) SetRecord(ctx context.Context, domain string, overrideIp string
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
log.Printf("[njalla ddns] Response: %s", string(body))
|
log.Printf("debug: [njalla ddns] Response: %s", string(body))
|
||||||
|
|
||||||
if resp.StatusCode < 200 || resp.StatusCode > 299 {
|
if resp.StatusCode < 200 || resp.StatusCode > 299 {
|
||||||
return "", errors.New("Not nice status code: " + strconv.Itoa(resp.StatusCode) + " with body: " + string(body))
|
return "", errors.New("Not nice status code: " + strconv.Itoa(resp.StatusCode) + " with body: " + string(body))
|
||||||
|
|
Reference in a new issue