1
- using log4net ;
2
- using log4net . Appender ;
3
- using log4net . Core ;
4
- using log4net . Filter ;
5
- using log4net . Layout ;
6
- using log4net . Repository . Hierarchy ;
7
1
using System ;
8
2
using System . Collections . Generic ;
9
3
using System . IO ;
@@ -13,15 +7,12 @@ namespace BrowserStack
13
7
{
14
8
public class Local
15
9
{
16
- private Hierarchy hierarchy ;
17
10
private string folder = "" ;
18
11
private string accessKey = "" ;
19
12
private string customLogPath = "" ;
20
13
private string argumentString = "" ;
21
14
private string customBinaryPath = "" ;
22
- private PatternLayout patternLayout ;
23
15
protected BrowserStackTunnel tunnel = null ;
24
- public static ILog logger = LogManager . GetLogger ( "Local" ) ;
25
16
private static KeyValuePair < string , string > emptyStringPair = new KeyValuePair < string , string > ( ) ;
26
17
27
18
private static List < KeyValuePair < string , string > > valueCommands = new List < KeyValuePair < string , string > > ( ) {
@@ -102,34 +93,9 @@ private void addArgs(string key, string value)
102
93
}
103
94
}
104
95
}
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
- }
129
96
130
97
public Local ( )
131
98
{
132
- setupLogging ( ) ;
133
99
tunnel = new BrowserStackTunnel ( ) ;
134
100
}
135
101
public void start ( List < KeyValuePair < string , string > > options )
@@ -166,7 +132,6 @@ public void start(List<KeyValuePair<string, string>> options)
166
132
tunnel . Run ( accessKey , folder , customLogPath , "start" ) ;
167
133
} catch ( Exception )
168
134
{
169
- logger . Warn ( "Running Local failed. Falling back to backup path." ) ;
170
135
except = true ;
171
136
}
172
137
if ( except )
0 commit comments