Skip to content

Commit

Permalink
Add daemon option
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyCTHsu committed Aug 30, 2024
1 parent cbff8ce commit 2f5826f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bin/catadog
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,8 @@ module Datadog
Logger: logger,
AccessLog: [[logger.instance_variable_get(:@logdev).dev, WEBrick::AccessLog::COMBINED_LOG_FORMAT]],
BindAddress: settings.host.to_s,
Port: settings.port
Port: settings.port,
ServerType: settings.daemon ? WEBrick::Daemon : WEBrick::SimpleServer
# RequestCallback: request_callback
}
end
Expand All @@ -366,7 +367,8 @@ module Datadog
:record_dir,
:silent,
:log,
:mocks
:mocks,
:daemon

def initialize
@debug = false
Expand All @@ -378,6 +380,7 @@ module Datadog
@agent_port = 8126
@record_dir = nil
@silent = false
@daemon = false
@log = $stderr
@mocks = []
end
Expand All @@ -402,6 +405,8 @@ module Datadog
case arg
when "-d", "--debug"
settings.debug = true
when "--daemon"
settings.daemon = true
when "-s", "--silent"
settings.silent = true
when "-v", "--verbose"
Expand Down

0 comments on commit 2f5826f

Please sign in to comment.