Skip to content

Commit 3fb40a1

Browse files
authored
Merge pull request #12 from browserstack/rem_logs
Remove unwanted logging
2 parents 2847eb2 + fb83f8d commit 3fb40a1

File tree

7 files changed

+3
-55
lines changed

7 files changed

+3
-55
lines changed

BrowserStackLocal.1.1.0.0.nupkg

-8.84 KB
Binary file not shown.

BrowserStackLocal.1.2.0.0.nupkg

7.23 KB
Binary file not shown.

BrowserStackLocal/BrowserStackLocal/BrowserStackLocal.csproj

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@
3232
<PlatformTarget>AnyCPU</PlatformTarget>
3333
</PropertyGroup>
3434
<ItemGroup>
35-
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
36-
<HintPath>..\packages\log4net.2.0.5\lib\net20-full\log4net.dll</HintPath>
37-
<Private>True</Private>
38-
</Reference>
3935
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
4036
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net20\Newtonsoft.Json.dll</HintPath>
4137
<Private>True</Private>
@@ -52,9 +48,7 @@
5248
<ItemGroup>
5349
<None Include="packages.config" />
5450
</ItemGroup>
55-
<ItemGroup>
56-
<Folder Include="log4net\" />
57-
</ItemGroup>
51+
<ItemGroup />
5852
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
5953
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
6054
Other similar extension points exist, see Microsoft.Common.targets.

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 & 36 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>>() {
@@ -40,7 +31,6 @@ public class Local
4031
new KeyValuePair<string, string>("forceproxy", "-forceproxy"),
4132
new KeyValuePair<string, string>("onlyAutomate", "-onlyAutomate"),
4233
};
43-
private readonly string LOG4NET_CONFIG_FILE_PATH = Path.Combine(Directory.GetCurrentDirectory(), "log_config.xml");
4434

4535
public bool isRunning()
4636
{
@@ -102,34 +92,9 @@ private void addArgs(string key, string value)
10292
}
10393
}
10494
}
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-
}
12995

13096
public Local()
13197
{
132-
setupLogging();
13398
tunnel = new BrowserStackTunnel();
13499
}
135100
public void start(List<KeyValuePair<string, string>> options)
@@ -166,7 +131,6 @@ public void start(List<KeyValuePair<string, string>> options)
166131
tunnel.Run(accessKey, folder, customLogPath, "start");
167132
} catch (Exception)
168133
{
169-
logger.Warn("Running Local failed. Falling back to backup path.");
170134
except = true;
171135
}
172136
if (except)

BrowserStackLocal/BrowserStackLocal/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.1.0.0")]
36-
[assembly: AssemblyFileVersion("1.1.0.0")]
35+
[assembly: AssemblyVersion("1.2.0.0")]
36+
[assembly: AssemblyFileVersion("1.2.0.0")]
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="log4net" version="2.0.5" targetFramework="net20" />
43
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net20" />
54
</packages>

0 commit comments

Comments
 (0)