Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrate logrus to zap #34

Merged
merged 4 commits into from
Jun 13, 2024
Merged

feat: migrate logrus to zap #34

merged 4 commits into from
Jun 13, 2024

Conversation

kashalls
Copy link
Owner

Migrates https://github.com/sirupsen/logrus to https://github.com/uber-go/zap as logrus is in mainteance-mode and will not be releasing anything of importance.

Closes #24

@kashalls kashalls added the enhancement New feature or request label Jun 12, 2024
@kashalls
Copy link
Owner Author

cc @onedr0p

@kashalls
Copy link
Owner Author

external-dns-provider-unifi
version: pr-34 (877a74d3363ca38ccb765e28516058bce1876de1)

{"level":"info","ts":1718227226.584895,"caller":"dnsprovider/dnsprovider.go:46","msg":"creating unifi provider with no kind of domain filters"}
{"level":"debug","ts":1718227226.585154,"caller":"unifi/client.go:99","msg":"making POST request to https://10.1.0.1/api/auth/login"}
{"level":"debug","ts":1718227226.5852578,"caller":"unifi/client.go:242","msg":"Requesting https://10.1.0.1/api/auth/login cookies: 0"}
{"level":"debug","ts":1718227226.8236408,"caller":"unifi/client.go:117","msg":"response code from POST request to https://10.1.0.1/api/auth/login: 200"}
{"level":"info","ts":1718227226.823977,"caller":"server/server.go:46","msg":"starting webhook server","address":"0.0.0.0:8888"}
{"level":"info","ts":1718227226.8241413,"caller":"server/server.go:59","msg":"starting health server","address":"0.0.0.0:8080"}
{"level":"debug","ts":1718227227.9255626,"caller":"webhook/webhook.go:103","msg":"requesting records","req_method":"GET","req_path":"/records"}
{"level":"debug","ts":1718227227.9256067,"caller":"unifi/client.go:99","msg":"making GET request to https://10.1.0.1/proxy/network/v2/api/site/default/static-dns/"}
{"level":"debug","ts":1718227227.9256258,"caller":"unifi/client.go:242","msg":"Requesting https://10.1.0.1/proxy/network/v2/api/site/default/static-dns/ cookies: 1"}
{"level":"debug","ts":1718227227.949754,"caller":"unifi/client.go:117","msg":"response code from GET request to https://10.1.0.1/proxy/network/v2/api/site/default/static-dns/: 200"}
{"level":"debug","ts":1718227227.9507217,"caller":"unifi/client.go:159","msg":"retrieved records: [{ Super Long List but Truncated :) ]"}
{"level":"debug","ts":1718227227.950851,"caller":"webhook/webhook.go:112","msg":"returning records","req_method":"GET","req_path":"/records","count":103}
{"level":"debug","ts":1718227227.9522557,"caller":"webhook/webhook.go:184","msg":"requesting adjust endpoints count","endpoints":10}
{"level":"debug","ts":1718227227.9523017,"caller":"webhook/webhook.go:193","msg":"return adjust endpoints response","endpoints":10}

@kashalls kashalls marked this pull request as ready for review June 12, 2024 21:23

return records, nil
}

// CreateEndpoint creates a new DNS record in the UniFi controller.
func (c *httpClient) CreateEndpoint(endpoint *endpoint.Endpoint) (*DNSRecord, error) {
logger := logging.GetLogger()
Copy link
Contributor

@onedr0p onedr0p Jun 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be imported from a custom logging module, not instantiated in every function.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kashalls kashalls requested a review from onedr0p June 13, 2024 19:32
@kashalls kashalls merged commit 6bc8b84 into main Jun 13, 2024
2 checks passed
@kashalls kashalls deleted the feat-zap branch June 14, 2024 01:04
szinn referenced this pull request in szinn/k8s-homelab Jun 14, 2024
…hook ( v0.1.0 → v0.2.0 ) (#3844)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[ghcr.io/kashalls/external-dns-unifi-webhook](https://togithub.com/kashalls/external-dns-unifi-webhook)
| minor | `v0.1.0` -> `v0.2.0` |

---

### Release Notes

<details>
<summary>kashalls/external-dns-unifi-webhook
(ghcr.io/kashalls/external-dns-unifi-webhook)</summary>

###
[`v0.2.0`](https://togithub.com/kashalls/external-dns-unifi-webhook/releases/tag/v0.2.0)

[Compare
Source](https://togithub.com/kashalls/external-dns-unifi-webhook/compare/v0.1.0...v0.2.0)

#### What's Changed

- chore(deps): update dependency go to v1.22.4 by
[@&#8203;renovate](https://togithub.com/renovate) in
[https://github.com/kashalls/external-dns-unifi-webhook/pull/31](https://togithub.com/kashalls/external-dns-unifi-webhook/pull/31)
- fix(deps): update module golang.org/x/net to v0.26.0 by
[@&#8203;renovate](https://togithub.com/renovate) in
[https://github.com/kashalls/external-dns-unifi-webhook/pull/32](https://togithub.com/kashalls/external-dns-unifi-webhook/pull/32)
- chore: Add CoC, CODEOWNERS, and issue templates by
[@&#8203;onedr0p](https://togithub.com/onedr0p) in
[https://github.com/kashalls/external-dns-unifi-webhook/pull/33](https://togithub.com/kashalls/external-dns-unifi-webhook/pull/33)
- feat: migrate logrus to zap by
[@&#8203;kashalls](https://togithub.com/kashalls) in
[https://github.com/kashalls/external-dns-unifi-webhook/pull/34](https://togithub.com/kashalls/external-dns-unifi-webhook/pull/34)

**Full Changelog**:
kashalls/external-dns-unifi-webhook@v0.1.0...v0.2.0

</details>

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MDcuMyIsInVwZGF0ZWRJblZlciI6IjM3LjQwNy4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL21pbm9yIl19-->

Co-authored-by: repo-jeeves[bot] <106431701+repo-jeeves[bot]@users.noreply.github.com>
szinn referenced this pull request in szinn/k8s-homelab Jun 14, 2024
…hook ( v0.1.0 → v0.2.0 ) (#3845)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[ghcr.io/kashalls/external-dns-unifi-webhook](https://togithub.com/kashalls/external-dns-unifi-webhook)
| minor | `v0.1.0` -> `v0.2.0` |

---

### Release Notes

<details>
<summary>kashalls/external-dns-unifi-webhook
(ghcr.io/kashalls/external-dns-unifi-webhook)</summary>

###
[`v0.2.0`](https://togithub.com/kashalls/external-dns-unifi-webhook/releases/tag/v0.2.0)

[Compare
Source](https://togithub.com/kashalls/external-dns-unifi-webhook/compare/v0.1.0...v0.2.0)

#### What's Changed

- chore(deps): update dependency go to v1.22.4 by
[@&#8203;renovate](https://togithub.com/renovate) in
[https://github.com/kashalls/external-dns-unifi-webhook/pull/31](https://togithub.com/kashalls/external-dns-unifi-webhook/pull/31)
- fix(deps): update module golang.org/x/net to v0.26.0 by
[@&#8203;renovate](https://togithub.com/renovate) in
[https://github.com/kashalls/external-dns-unifi-webhook/pull/32](https://togithub.com/kashalls/external-dns-unifi-webhook/pull/32)
- chore: Add CoC, CODEOWNERS, and issue templates by
[@&#8203;onedr0p](https://togithub.com/onedr0p) in
[https://github.com/kashalls/external-dns-unifi-webhook/pull/33](https://togithub.com/kashalls/external-dns-unifi-webhook/pull/33)
- feat: migrate logrus to zap by
[@&#8203;kashalls](https://togithub.com/kashalls) in
[https://github.com/kashalls/external-dns-unifi-webhook/pull/34](https://togithub.com/kashalls/external-dns-unifi-webhook/pull/34)

**Full Changelog**:
kashalls/external-dns-unifi-webhook@v0.1.0...v0.2.0

</details>

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MDcuMyIsInVwZGF0ZWRJblZlciI6IjM3LjQwNy4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL21pbm9yIl19-->

Co-authored-by: repo-jeeves[bot] <106431701+repo-jeeves[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider replacing the logging library logrus with zap
3 participants