sqlness icon indicating copy to clipboard operation
sqlness copied to clipboard

Refactor UI to use structured output util

Open waynexia opened this issue 3 years ago • 4 comments

Describe This Problem

Currently sqlness outputs everything with println!. This is hard to maintain.

Proposal

Consider a structured way to organize our outputs. Either using existing util like TestReporter from nextest or wrap our own.

Additional Context

No response

waynexia avatar Mar 02 '23 03:03 waynexia

Any user case to collect stdout output?

jiacai2050 avatar Mar 02 '23 14:03 jiacai2050

Any user case to collect stdout output?

No for now, just for refactoring

waynexia avatar Mar 02 '23 16:03 waynexia

Then I suggest we could define a trait to collect those info

trait Collector {
  fn append(&self, &str) -> Result<()>
  fn flush(&self) -> Result<()>
}

jiacai2050 avatar Mar 03 '23 02:03 jiacai2050

Not sure if these are enough. This collector may also be exposed to users to replace their println in their sqlness runner

waynexia avatar Mar 06 '23 02:03 waynexia