Fix custom log format

This commit is contained in:
Manuel de Brito Fontes 2017-03-06 12:06:56 -03:00
parent de8b9b8df2
commit f0c758eed2
2 changed files with 12 additions and 8 deletions

View file

@ -12,10 +12,10 @@ func TestBuildLogFormatUpstream(t *testing.T) {
curLogFormat string
expected string
}{
{true, logFormatUpstream, fmt.Sprintf("$proxy_protocol_addr - %s", logFormatUpstream)},
{false, logFormatUpstream, fmt.Sprintf("$remote_addr - %s", logFormatUpstream)},
{true, "my-log-format", "$proxy_protocol_addr - my-log-format"},
{false, "john-log-format", "$remote_addr - john-log-format"},
{true, logFormatUpstream, fmt.Sprintf(logFormatUpstream, "$proxy_protocol_addr")},
{false, logFormatUpstream, fmt.Sprintf(logFormatUpstream, "$remote_addr")},
{true, "my-log-format", "my-log-format"},
{false, "john-log-format", "john-log-format"},
}
for _, testCase := range testCases {