mirror of
https://github.com/shadowsocks/ShadowsocksX-NG.git
synced 2026-10-29 13:43:49 +00:00
feat(agent): omit sslocal log timestamps
This commit is contained in:
@@ -83,7 +83,7 @@ func spawnSslocal() -> Process? {
|
||||
if data.isEmpty { handle.readabilityHandler = nil }
|
||||
}
|
||||
child.executableURL = sslocalURL
|
||||
child.arguments = ["-c", contractURL.path]
|
||||
child.arguments = ["-c", contractURL.path, "--log-without-time"]
|
||||
var childEnvironment = environment
|
||||
// 不配置 sslocal 日志级别;未设置时使用上游默认值,显式外部 RUST_LOG 原样透传。
|
||||
// macOS 的 resolv.conf 可能含带 zone id 的链路本地 nameserver(RA 下发的
|
||||
|
||||
@@ -171,10 +171,13 @@ final class AgentLifecycleCoreTests: AgentLifecycleTests {
|
||||
func testStartProtocolSpawnsSslocalWithAbsoluteConfigPathThenStopsOnSIGTERM() throws {
|
||||
try writeContract(ProxyRuntimeFixture.makeDocument())
|
||||
let wrapper = try launchWrapper(behavior: "run")
|
||||
let expectedInvocation = "invoked: -c \(contractURL.path) --log-without-time"
|
||||
|
||||
XCTAssertTrue(
|
||||
try waitUntil { self.stateLog().contains("invoked: -c \(self.contractURL.path)") },
|
||||
"wrapper 应以契约绝对路径调用 sslocal,实际:\(stateLog())")
|
||||
try waitUntil {
|
||||
self.stateLog().components(separatedBy: .newlines).contains(expectedInvocation)
|
||||
},
|
||||
"wrapper 应以契约绝对路径及无上游时间参数调用 sslocal,实际:\(stateLog())")
|
||||
XCTAssertTrue(pidAlive(wrapper.processIdentifier), "sslocal 运行期间 wrapper 应保持常驻")
|
||||
|
||||
XCTAssertThrowsError(try waitForExit(wrapper, timeout: 0.01))
|
||||
|
||||
Reference in New Issue
Block a user