Disabling echo from webrick

前端 未结 1 877
我在风中等你
我在风中等你 2021-01-04 03:48

How can I disable messages from webrick echoed on to the terminal? For the INFO messages that appear at the beginning, I was able to disable it by setting the <

相关标签:
1条回答
  • 2021-01-04 04:24

    Following the link to the source and suggestion provied by Yet Another Geek, I was able to figure out a way. Set the AccessLog parameter to [nil, nil] [] (Changed following suggestion by Robert Watkins).

    s = WEBrick::HTTPServer.new(
      Port: 3000,
      BindAddress: "localhost",
      Logger: WEBrick::Log.new("/dev/null"),
      AccessLog: [],
    )
    
    0 讨论(0)
提交回复
热议问题