aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2018-07-19 15:16:35 +0100
committerGravatar Yong Tang <yong.tang.github@outlook.com> 2018-07-19 07:16:35 -0700
commitc69bed726b4a7b8726833e009ed6dd70a74f0dec (patch)
tree1adba483932317e2f91dc1d77f644fb578a1fb8f /plugin
parent6621931620e65ef6b4d88ca119eb5a0eaa16fe58 (diff)
downloadcoredns-c69bed726b4a7b8726833e009ed6dd70a74f0dec.tar.gz
coredns-c69bed726b4a7b8726833e009ed6dd70a74f0dec.tar.zst
coredns-c69bed726b4a7b8726833e009ed6dd70a74f0dec.zip
plugin/hosts: add log.Debug (#1985)
Logs the amount of entries we parsed after every parse, but only when debug is loaded. Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'plugin')
-rw-r--r--plugin/hosts/hostsfile.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/plugin/hosts/hostsfile.go b/plugin/hosts/hostsfile.go
index 4b912b17c..1d87f82f7 100644
--- a/plugin/hosts/hostsfile.go
+++ b/plugin/hosts/hostsfile.go
@@ -54,6 +54,22 @@ func newHostsMap() *hostsMap {
}
}
+// Len returns the total number of addresses in the hostmap, this includes
+// V4/V6 and any reverse addresses.
+func (h *hostsMap) Len() int {
+ l := 0
+ for _, v4 := range h.byNameV4 {
+ l += len(v4)
+ }
+ for _, v6 := range h.byNameV6 {
+ l += len(v6)
+ }
+ for _, a := range h.byAddr {
+ l += len(a)
+ }
+ return l
+}
+
// Hostsfile contains known host entries.
type Hostsfile struct {
sync.RWMutex
@@ -111,6 +127,8 @@ func (h *Hostsfile) initInline(inline []string) {
func (h *Hostsfile) parseReader(r io.Reader) {
h.hmap = h.parse(r, h.inline)
+
+ log.Debugf("Parsed hosts file into %d entries", h.hmap.Len())
}
// Parse reads the hostsfile and populates the byName and byAddr maps.
ain'>origin/main Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/test/snippets/jsx-spacing.js (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2023-09-13chore(docs): include missing links to Node.js APIs (#5281)Gravatar Steven 1-2/+2
These links make it easy to click and jump to another section.
2023-09-13docs(guide): fix expect assertion example in guide for `spyOn` (#5294)Gravatar wing 1-1/+1
Fixes example with `spyOn` and assertions. The example failed because the spied function would be called once but the expectation asserted 0 calls.
2023-09-13add uninstall instructions (#5311)Gravatar Andrew Brown 1-0/+24
it's always good to have uninstall instructions as well as install, and I couldn't find them anywhere else on the site. IMO, this gives users a little more confidence to try new tools out, as they know it's easily reversible. I'm not familiar with how to uninstall with Docker, so would appreciate some help there. We could possibly add a note for "bash" on how to remove Bun from the `$PATH`.
2023-09-13docs: update lockfile diff instructions (#5275)Gravatar Guilherme J. Tramontina 1-3/+7
2023-09-13fix(node/fetch): Make data URL fetch consistent with node (#5126)Gravatar David Hewitt 2-7/+37
2023-09-13avoid inserting extraneous"accept-encoding" header (#5057)Gravatar iidebyo 2-1/+22
* add no extraneous accept-encoding header test * ensure fetch honors no decompress opt * fix format on test/js/node/http/node-http.test.ts
2023-09-13docs(runtime): fix plugins loader extensions typo (#5250)Gravatar Zong 1-1/+1
2023-09-13chore: make comment grammatically correct (#5140)Gravatar Gareth Jones 1-1/+1
2023-09-13Add informative message on 'bun create react' (#5248)Gravatar Colin McDonnell 1-0/+22
2023-09-13docs(runtime): fix jsx FragmentFactory output example (#5243)Gravatar Zong 1-1/+1
2023-09-13file.exists() needs to be awaited to get the value (#5061)Gravatar amt8u 1-1/+1
2023-09-13Update discordjs.md (#5227)Gravatar Antonin CLAUZIER 1-1/+1
2023-09-13decode regex if needed (#5167)Gravatar Dylan Conway 5-126/+167
* decode regex if non-ascii * make it comptime * add test * use `bun.BabyList(u16)`
2023-09-13Correct the configuration file names. (#5234)Gravatar Nathan Hammond 2-2/+2
2023-09-12Update tsconfig.json for bun initGravatar Colin McDonnell 1-1/+1
2023-09-12js/node/stream.js: call write() callback when encoding is not provided (#4841)Gravatar cfal 2-3/+7
* js/node/stream.js: call write() callback when encoding is not provided * js/out/InternalModuleRegistryConstants.h: update
2023-09-12docs: Made bun-types install as dev dependency in example (#5120)Gravatar Gordon Goldbach 1-1/+1
2023-09-12Various docs (#5201)Gravatar Colin McDonnell 4-4/+147
* Updates * Improve jest guide * Improve
2023-09-12Use git's --global flag for lockfile diffs instead of manually modifying ↵Gravatar Southpaw 1-17/+7
config files (#5143)
2023-09-12docs: fix typo in import.meta.resolve (#5146)Gravatar Jonathan Neal 1-1/+1
2023-09-12Update hot.md (#4990)Gravatar Nazeel 1-1/+1
2023-09-12Update simple.md (#4997)Gravatar Tom Redman 1-1/+1
Remove errant slash preventing the correct console log
2023-09-12fix typo and grammar errors (#5046)Gravatar xnacly 1-3/+3
2023-09-12clang and llvm on arch install v16, update to use v15 (#5069)Gravatar mi4uu 1-1/+10
2023-09-12Add missing full stop on nodejs-apis.md (#5072)Gravatar Diogo Goncalves 1-5/+5
2023-09-12udate README.md (#5127)Gravatar Toby 1-1/+1
update path
2023-09-12docs: fix typos (#5151)Gravatar Samuel Rigaud 17-18/+18
2023-09-12fix lifecycle docu (#5159)Gravatar Thomas Rupprecht 1-4/+4
2023-09-12Clean up Modules docGravatar Colin McDonnell 1-66/+73