-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLogger.java
More file actions
41 lines (32 loc) · 856 Bytes
/
Logger.java
File metadata and controls
41 lines (32 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.adobe.server;
import java.io.IOException;
/**
* Simple logger implementation. Will format text and will delegate to other
* logging mechanisms.
*
* @author VictorBucutea
*
*/
public class Logger {
public void log(String text) {
System.out.println(text);
}
public void logStartingServer(int port) {
log("--- Starting server ---");
}
public void logListenToConnection(int port ){
log("--- Server started. Listening to connections on port "+port+" --- ");
}
public void logServerStopped() {
log("--- Server stopped ---");
}
public void logCannotBindToPort(int port) {
log("Cannot bind to port "+port +".");
}
public void error(IOException e) {
e.printStackTrace();
}
public void logUploadFile(String workingDir, String filePath) {
log("--- Uploading file "+filePath+" in directory "+workingDir);
}
}