logary icon indicating copy to clipboard operation
logary copied to clipboard

Document how to use for local testing

Open haf opened this issue 7 years ago • 0 comments

      let logary =
        Config.create "EndToEndTests" (Dns.GetHostName())
        |> Config.targets [ LiterateConsole.create LiterateConsole.empty "console" ]
        |> Config.ilogger (ILogger.LiterateConsole Verbose)
        |> Config.loggerLevels [ ".*", LogLevel.Debug ]
        |> Config.processing (Events.events |> Events.sink [ "console" ])
        |> Config.build
        |> run

      LogaryFacadeAdapter.initialise<Expecto.Logging.Logger> logary

      let errorSink = ExpectoIndirection.createErrorSink cts.Token
      let post =
        Codecs.Codec.log4jXML // or whichever method you use for sending to Rutta
        >> Result.map (FromNetwork >> errorSink.Post)
        >> Job.result

...meanwhile in your app, create a target for UDP or Shipper and spawn Rutta in a container.

ErrorSink is used to assert there are no errors logged from your SUT (your whole system) while you're interacting with it.

haf avatar Apr 25 '18 13:04 haf