apollo-log icon indicating copy to clipboard operation
apollo-log copied to clipboard

Values of variables

Open sneznaovca opened this issue 4 years ago • 3 comments

Hi, What do you think about new option that enable log values of variables?

sneznaovca avatar Sep 08 '21 20:09 sneznaovca

It's not something you'd want enabled by default - that'd be asking to get in trouble by logging a lot of potential PII. I'd be up for adding an option that would add additional data to the mutate option.

shellscape avatar Sep 08 '21 21:09 shellscape

I agree that should be by default disabled. I think about new options variableValues and it just switch using Object.keys https://github.com/shellscape/apollo-log/blob/master/src/index.ts#L70 Or adding options to mutate, can looks like mutate(data:Record<string, string>, values: Record<string, string> and without override will serialize only data same as now. But I don't like combine it. If someone will want turn it, that must doing two steps? Enable new options and modify mutate function?

sneznaovca avatar Sep 10 '21 07:09 sneznaovca

If this goes ahead it'd be worthwhile to add a blacklist of variables too (e.g. password or cc_number) that just replaces them with ***** or something like that.

markhughes avatar Sep 28 '21 04:09 markhughes