merge log into common log

This commit is contained in:
Darien Raymond committed 2017-12-19 21:28:12 +01:00
1 parent 054ceb865d
commit f4c35db968
45 files changed
+297 -406

No files matched your search

+4 -5
View File
@@ -8,7 +8,6 @@ import (
"v2ray.com/core/app"
"v2ray.com/core/app/dispatcher"
"v2ray.com/core/app/log"
"v2ray.com/core/app/proxyman"
"v2ray.com/core/app/router"
"v2ray.com/core/common"
@@ -78,7 +77,7 @@ func (d *DefaultDispatcher) Dispatch(ctx context.Context, destination net.Destin
go func() {
domain, err := snifer(ctx, sniferList, outbound)
if err == nil {
log.Trace(newError("sniffed domain: ", domain))
newError("sniffed domain: ", domain).WriteToLog()
destination.Address = net.ParseAddress(domain)
ctx = proxy.ContextWithTarget(ctx, destination)
}
@@ -123,13 +122,13 @@ func (d *DefaultDispatcher) routedDispatch(ctx context.Context, outbound ray.Out
if d.router != nil {
if tag, err := d.router.TakeDetour(ctx); err == nil {
if handler := d.ohm.GetHandler(tag); handler != nil {
log.Trace(newError("taking detour [", tag, "] for [", destination, "]"))
newError("taking detour [", tag, "] for [", destination, "]").WriteToLog()
dispatcher = handler
} else {
log.Trace(newError("nonexisting tag: ", tag).AtWarning())
newError("nonexisting tag: ", tag).AtWarning().WriteToLog()
}
} else {
log.Trace(newError("default route for ", destination))
newError("default route for ", destination).WriteToLog()
}
}
dispatcher.Dispatch(ctx, outbound)