Skip to content

Commit cc01d34

Browse files
committed
remove logging
1 parent 2847eb2 commit cc01d34

File tree

2 files changed

+0
-44
lines changed

2 files changed

+0
-44
lines changed

BrowserStackLocal/BrowserStackLocal/BrowserStackTunnel.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
using System;
22
using System.IO;
3-
using System.Collections.Generic;
43
using System.Diagnostics;
54
using System.Text;
6-
using System.Text.RegularExpressions;
75
using System.Net;
86

97
using System.Security.AccessControl;
108
using System.Security.Principal;
11-
using System.Threading;
129
using Newtonsoft.Json;
1310
using Newtonsoft.Json.Linq;
1411

@@ -78,14 +75,11 @@ public void downloadBinary()
7875

7976
using (var client = new WebClient())
8077
{
81-
Local.logger.Info("Downloading BrowserStackLocal..");
8278
client.DownloadFile(downloadURL, this.binaryAbsolute);
83-
Local.logger.Info("Binary Downloaded.");
8479
}
8580

8681
if (!File.Exists(binaryAbsolute))
8782
{
88-
Local.logger.Error("Error accessing downloaded zip. Please check file permissions.");
8983
throw new Exception("Error accessing file " + binaryAbsolute);
9084
}
9185

@@ -108,7 +102,6 @@ public virtual void Run(string accessKey, string folder, string logFilePath, str
108102
}
109103
if (!File.Exists(binaryAbsolute))
110104
{
111-
Local.logger.Warn("BrowserStackLocal binary was not found at " + binaryAbsolute);
112105
downloadBinary();
113106
}
114107

@@ -121,8 +114,6 @@ public virtual void Run(string accessKey, string folder, string logFilePath, str
121114
{
122115
File.WriteAllText(logFilePath, string.Empty);
123116
}
124-
Local.logger.Info("BrowserStackLocal binary is located at " + binaryAbsolute);
125-
Local.logger.Info("Starting Binary with arguments " + arguments.Replace(accessKey, "<access_key>"));
126117
RunProcess(arguments, processType);
127118
}
128119

BrowserStackLocal/BrowserStackLocal/Local.cs

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
using log4net;
2-
using log4net.Appender;
3-
using log4net.Core;
4-
using log4net.Filter;
5-
using log4net.Layout;
6-
using log4net.Repository.Hierarchy;
71
using System;
82
using System.Collections.Generic;
93
using System.IO;
@@ -13,15 +7,12 @@ namespace BrowserStack
137
{
148
public class Local
159
{
16-
private Hierarchy hierarchy;
1710
private string folder = "";
1811
private string accessKey = "";
1912
private string customLogPath = "";
2013
private string argumentString = "";
2114
private string customBinaryPath = "";
22-
private PatternLayout patternLayout;
2315
protected BrowserStackTunnel tunnel = null;
24-
public static ILog logger = LogManager.GetLogger("Local");
2516
private static KeyValuePair<string, string> emptyStringPair = new KeyValuePair<string, string>();
2617

2718
private static List<KeyValuePair<string, string>> valueCommands = new List<KeyValuePair<string, string>>() {
@@ -102,34 +93,9 @@ private void addArgs(string key, string value)
10293
}
10394
}
10495
}
105-
private void setupLogging()
106-
{
107-
hierarchy = (Hierarchy)LogManager.GetRepository();
108-
109-
patternLayout = new PatternLayout();
110-
patternLayout.ConversionPattern = "%date [%thread] %-5level %logger - %message%newline";
111-
patternLayout.ActivateOptions();
112-
113-
ConsoleAppender consoleAppender = new ConsoleAppender();
114-
consoleAppender.Threshold = Level.Info;
115-
consoleAppender.Layout = patternLayout;
116-
consoleAppender.ActivateOptions();
117-
118-
LoggerMatchFilter loggerMatchFilter = new LoggerMatchFilter();
119-
loggerMatchFilter.LoggerToMatch = "Local";
120-
loggerMatchFilter.AcceptOnMatch = true;
121-
consoleAppender.AddFilter(loggerMatchFilter);
122-
consoleAppender.AddFilter(new DenyAllFilter());
123-
124-
hierarchy.Root.AddAppender(consoleAppender);
125-
126-
hierarchy.Root.Level = Level.All;
127-
hierarchy.Configured = true;
128-
}
12996

13097
public Local()
13198
{
132-
setupLogging();
13399
tunnel = new BrowserStackTunnel();
134100
}
135101
public void start(List<KeyValuePair<string, string>> options)
@@ -166,7 +132,6 @@ public void start(List<KeyValuePair<string, string>> options)
166132
tunnel.Run(accessKey, folder, customLogPath, "start");
167133
} catch (Exception)
168134
{
169-
logger.Warn("Running Local failed. Falling back to backup path.");
170135
except = true;
171136
}
172137
if (except)

0 commit comments

Comments
 (0)