PowerDNS / pdns

PowerDNS Authoritative, PowerDNS Recursor, dnsdist
https://www.powerdns.com/
GNU General Public License v2.0
3.7k stars 909 forks source link

Please ship table inspector in dnsdist #6690

Open zeha opened 6 years ago

zeha commented 6 years ago

Short description

Some commands or user-made functions may return tables, and there is no way to look at them.

For std::unordered_map<string, double> there's an internal implementation for printing.

Usecase

Inspect tables regardless of their contents.

Description

Include an inspection tool in box.

@Habbie likes https://github.com/Hammerspoon/hammerspoon/blob/9ef346e2d8c4abd406dd3806e2815504b3c0dac3/extensions/inspect/init.lua

I used https://gist.github.com/stuby/5445834#file-rprint-lua the other day.

phonedph1 commented 6 years ago

Maybe only somewhat related - but some types also try to default to unordered_map if I understand this correctly.

> getPool("default"):getCache():isFull()
Command returned an object we can't print: Trying to cast a lua variable from "boolean" to "N5boost8optionalINS_7variantISsJSt10shared_ptrI15DownstreamStateEP11ClientStateSt13unordered_mapISsdSt4hashISsESt8equal_toISsESaISt4pairIKSsdEEEEEEEE"
>
zeha commented 6 years ago

That error specifically means that dnsdist is trying to understand the object as either:

but nothing else :)