1 2 24 25 package com.lutris.logging; 26 27 28 34 public class MonologWriter extends LogWriter { 35 38 private LogChannel channel; 39 private int level; 40 41 44 private boolean enabled; 45 46 51 protected MonologWriter(LogChannel logChannel, 52 String logLevel) 53 { 54 this(logChannel, logChannel.getLevel(logLevel)); 55 } 56 57 62 protected MonologWriter(LogChannel logChannel, 63 int logLevel) { 64 66 super(logChannel, logLevel); 67 channel = logChannel; 68 level = logLevel; 69 enabled = logChannel.isEnabled(level); 70 } 71 72 75 public LogChannel getChannel() { 76 return channel; 77 } 78 79 82 public int getLevel() { 83 return level; 84 } 85 86 94 98 104 public void println(String msg, Throwable throwable) { 105 if (enabled) { 106 channel.write(level, msg, throwable); 108 } 109 } 110 } 111 112 | Popular Tags |