11
11
import com .danikula .videocache .headers .HeaderInjector ;
12
12
import com .danikula .videocache .sourcestorage .SourceInfoStorage ;
13
13
import com .danikula .videocache .sourcestorage .SourceInfoStorageFactory ;
14
- import org .slf4j .Logger ;
15
- import org .slf4j .LoggerFactory ;
16
14
import java .io .File ;
17
15
import java .io .IOException ;
18
16
import java .net .InetAddress ;
49
47
*/
50
48
public class HttpProxyCacheServer {
51
49
52
- private static final Logger LOG = LoggerFactory .getLogger ("HttpProxyCacheServer" );
53
50
private static final String PROXY_HOST = "127.0.0.1" ;
54
51
55
52
private final Object clientsLock = new Object ();
@@ -77,7 +74,7 @@ private HttpProxyCacheServer(Config config) {
77
74
this .waitConnectionThread .start ();
78
75
startSignal .await (); // freeze thread, wait for server starts
79
76
this .pinger = new Pinger (PROXY_HOST , port );
80
- LOG .info ("Proxy cache server started. Is it alive? " + isAlive ());
77
+ CacheLog .info ("Proxy cache server started. Is it alive? " + isAlive ());
81
78
} catch (IOException | InterruptedException e ) {
82
79
socketProcessor .shutdown ();
83
80
throw new IllegalStateException ("Error starting local proxy server" , e );
@@ -124,7 +121,7 @@ public void registerCacheListener(CacheListener cacheListener, String url) {
124
121
try {
125
122
getClients (url ).registerCacheListener (cacheListener );
126
123
} catch (ProxyCacheException e ) {
127
- LOG .warn ("Error registering cache listener" , e );
124
+ CacheLog .warn ("Error registering cache listener" , e );
128
125
}
129
126
}
130
127
}
@@ -135,7 +132,7 @@ public void unregisterCacheListener(CacheListener cacheListener, String url) {
135
132
try {
136
133
getClients (url ).unregisterCacheListener (cacheListener );
137
134
} catch (ProxyCacheException e ) {
138
- LOG .warn ("Error registering cache listener" , e );
135
+ CacheLog .warn ("Error registering cache listener" , e );
139
136
}
140
137
}
141
138
}
@@ -165,7 +162,7 @@ public boolean isCached(String url) {
165
162
}
166
163
167
164
public void shutdown () {
168
- LOG .info ("Shutdown proxy server" );
165
+ CacheLog .info ("Shutdown proxy server" );
169
166
170
167
shutdownClients ();
171
168
@@ -288,7 +285,7 @@ private void closeSocketInput(Socket socket) {
288
285
} catch (SocketException e ) {
289
286
// There is no way to determine that client closed connection http://stackoverflow.com/a/10241044/999458
290
287
// So just to prevent log flooding don't log stacktrace
291
- LOG .debug ("Releasing input stream… Socket is closed by client." );
288
+ CacheLog .debug ("Releasing input stream… Socket is closed by client." );
292
289
} catch (Throwable e ) {
293
290
// onError(new ProxyCacheException("Error closing socket input stream", e));
294
291
}
@@ -315,7 +312,7 @@ private void closeSocket(Socket socket) {
315
312
}
316
313
317
314
private void onError (Throwable e ) {
318
- LOG .error ("HttpProxyCacheServer error" , e );
315
+ CacheLog .error ("HttpProxyCacheServer error" , e );
319
316
}
320
317
321
318
private final class WaitRequestsRunnable implements Runnable {
0 commit comments