cabbage-ex / cabbage

Story BDD tool for executing elixir in ExUnit
MIT License
138 stars 33 forks source link

How to log steps ala Cucumber #53

Open hisapy opened 5 years ago

hisapy commented 5 years ago

THIS IS NOT AN ISSUE.

Hey devs ... If you want to log your feature step by step similar to how Cucumber logs in Ruby, then you can use FlexLogger and configure it in your test config file.

# file config/test.exs
config :logger,
  backends: [{FlexLogger, :test_logger}, {FlexLogger, :default_logger}]

config :logger, :test_logger,
  logger: :console,
  default_level: :off,
 # the tests that use Cabbage start with FeatureTest. i.e.: FeatureTest.CreatePost
  level_config: [module: FeatureTest, level: :info],
  format: " $levelpad$message\n"

config :logger, :default_logger,
  logger: :console,
  default_level: :warn,
  format: "\n$time $metadata[$level] $levelpad$message\n"

This info might fit quite well into the README and then close this ticket ...

jalcine commented 5 years ago

This could be placed into the Wiki versus opening a whole issue.

revati commented 5 years ago

Yes, completely agree, I'm currently are in progress to push this repository to 1.0. Updating documentation is one of the steps. This also will be integrated ;) This also could change, due to code changes in general.