29 lines
		
	
	
	
		
			694 B
		
	
	
	
		
			Java
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
	
		
			694 B
		
	
	
	
		
			Java
		
	
	
	
	
	
| package net.minecraft.server;
 | |
| 
 | |
| import com.mojang.logging.LogUtils;
 | |
| import java.io.OutputStream;
 | |
| import java.io.PrintStream;
 | |
| import org.jetbrains.annotations.Nullable;
 | |
| import org.slf4j.Logger;
 | |
| 
 | |
| public class LoggedPrintStream extends PrintStream {
 | |
| 	private static final Logger LOGGER = LogUtils.getLogger();
 | |
| 	protected final String name;
 | |
| 
 | |
| 	public LoggedPrintStream(String name, OutputStream out) {
 | |
| 		super(out);
 | |
| 		this.name = name;
 | |
| 	}
 | |
| 
 | |
| 	public void println(@Nullable String string) {
 | |
| 		this.logLine(string);
 | |
| 	}
 | |
| 
 | |
| 	public void println(Object object) {
 | |
| 		this.logLine(String.valueOf(object));
 | |
| 	}
 | |
| 
 | |
| 	protected void logLine(@Nullable String string) {
 | |
| 		LOGGER.info("[{}]: {}", this.name, string);
 | |
| 	}
 | |
| }
 |