Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Snowflake WebExtension
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Cecylia Bocovich
Snowflake WebExtension
Commits
12922a23
Commit
12922a23
authored
7 years ago
by
David Fifield
Browse files
Options
Downloads
Patches
Plain Diff
Make logging optional and controlled by a -log option.
parent
f418ec7a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
client/snowflake.go
+14
-16
14 additions, 16 deletions
client/snowflake.go
with
14 additions
and
16 deletions
client/snowflake.go
+
14
−
16
View file @
12922a23
...
...
@@ -10,7 +10,6 @@ import (
"net"
"os"
"os/signal"
"path"
"sync"
"syscall"
"time"
...
...
@@ -122,29 +121,28 @@ func copyLoop(a, b io.ReadWriter) {
}
func
main
()
{
webrtc
.
SetLoggingVerbosity
(
1
)
stateDir
,
err
:=
pt
.
MakeStateDir
()
if
err
!=
nil
{
log
.
Fatal
(
err
)
}
logFile
,
err
:=
os
.
OpenFile
(
path
.
Join
(
stateDir
,
"snowflake.log"
),
os
.
O_CREATE
|
os
.
O_APPEND
|
os
.
O_WRONLY
,
0600
)
if
err
!=
nil
{
log
.
Fatal
(
err
)
}
defer
logFile
.
Close
()
log
.
SetOutput
(
logFile
)
var
iceServers
IceServerList
log
.
Println
(
"
\n\n\n
--- Starting Snowflake Client ---"
)
flag
.
Var
(
&
iceServers
,
"ice"
,
"comma-separated list of ICE servers"
)
brokerURL
:=
flag
.
String
(
"url"
,
""
,
"URL of signaling broker"
)
frontDomain
:=
flag
.
String
(
"front"
,
""
,
"front domain"
)
logFilename
:=
flag
.
String
(
"log"
,
""
,
"name of log file"
)
max
:=
flag
.
Int
(
"max"
,
DefaultSnowflakeCapacity
,
"capacity for number of multiplexed WebRTC peers"
)
flag
.
Parse
()
webrtc
.
SetLoggingVerbosity
(
1
)
if
*
logFilename
!=
""
{
logFile
,
err
:=
os
.
OpenFile
(
*
logFilename
,
os
.
O_CREATE
|
os
.
O_APPEND
|
os
.
O_WRONLY
,
0600
)
if
err
!=
nil
{
log
.
Fatal
(
err
)
}
defer
logFile
.
Close
()
log
.
SetOutput
(
logFile
)
}
log
.
Println
(
"
\n\n\n
--- Starting Snowflake Client ---"
)
// Prepare to collect remote WebRTC peers.
snowflakes
:=
NewPeers
(
*
max
)
if
""
!=
*
brokerURL
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment