Use thread to read stdin
Message format can be set from command line