Skip to content

Log output isn't deterministic? #2

Description

@L7R7

I have a simple example using polysemy-log and polysemy-log-co, which is similar to the tests you have in place.

You can find my code here, the essential parts are:

main :: IO ()
main =
  runFinal
    . embedToFinal @IO
    . interpretTimeGhc
    . runResource
    . interpretCologConcNative
    . interpretLogColog
    $ prog

prog :: Member Log r => Sem r ()
prog = do
  Log.debug "debugging"
  Log.info "info"
  Log.error "failing"

However, the output seems to be not deterministic. Sometimes, the first log message doesn't appear in the output. The following screenshot shows the output of the executable built with stack from my project. I would expect the same output on every run, but this isn't the case:

example of output for running the program multiple times

To me, that seems to be a bug. What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions