AlecAivazis / survey

A golang library for building interactive and accessible prompts with full support for windows and posix terminals.
MIT License
4.07k stars 349 forks source link

Better logging #464

Open catalinux17 opened 1 year ago

catalinux17 commented 1 year ago

I want to use zap to log exactly what users see.

? Your SSH key is expired. Do you want to update it? Yes
? Do you want to generate a SSH key? Yes
? What format do you want the SSH key to be?  [Use arrows to move, type to filter]
> ED25519 - Preferred due to its security
  RSA - More compatible with older systems

Right now, I only log the question prompt and the answer, but not the cute interface with ? and >.

Any ideas? Thanks.

mislav commented 1 year ago

Hi, what is zap, and why do you need to log the "cute interface"?

Right now, Survey has no internal logger of its own. However, you can edit your app to add logging around invocations of survey.Ask() and survey.AskOne() if you want to log the fact that the user was presented with some prompts.