Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Anti-censorship
Pluggable Transports
Snowflake
Commits
b4a4a256
Commit
b4a4a256
authored
Apr 12, 2019
by
Cecylia Bocovich
Browse files
Ported log sanitization to client
parent
482d60d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
client/snowflake.go
View file @
b4a4a256
...
...
@@ -16,6 +16,7 @@ import (
"git.torproject.org/pluggable-transports/goptlib.git"
sf
"git.torproject.org/pluggable-transports/snowflake.git/client/lib"
"git.torproject.org/pluggable-transports/snowflake.git/common/safelog"
"github.com/keroserene/go-webrtc"
)
...
...
@@ -77,6 +78,12 @@ func main() {
webrtc
.
SetLoggingVerbosity
(
1
)
log
.
SetFlags
(
log
.
LstdFlags
|
log
.
LUTC
)
// Don't write to stderr; versions of tor earlier than about
// 0.3.5.6 do not read from the pipe, and eventually we will
// deadlock because the buffer is full.
// https://bugs.torproject.org/26360
// https://bugs.torproject.org/25600#comment:14
var
logOutput
io
.
Writer
=
ioutil
.
Discard
if
*
logFilename
!=
""
{
if
*
logToStateDir
{
stateDir
,
err
:=
pt
.
MakeStateDir
()
...
...
@@ -91,15 +98,10 @@ func main() {
log
.
Fatal
(
err
)
}
defer
logFile
.
Close
()
log
.
SetOutput
(
logFile
)
}
else
{
// Don't write to stderr; versions of tor earlier than about
// 0.3.5.6 do not read from the pipe, and eventually we will
// deadlock because the buffer is full.
// https://bugs.torproject.org/26360
// https://bugs.torproject.org/25600#comment:14
log
.
SetOutput
(
ioutil
.
Discard
)
logOutput
=
logFile
}
//We want to send the log output through our scrubber first
log
.
SetOutput
(
&
safelog
.
LogScrubber
{
Output
:
logOutput
})
log
.
Println
(
"
\n\n\n
--- Starting Snowflake Client ---"
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment