private static int addLog(int level, String tag, String msg, Throwable throwable) { if (stream != null) { logToStream(stream, level, tag, msg, throwable); } LogItem item = new LogItem(level, tag, msg, throwable); Queue<LogItem> itemList; synchronized (logsByTag) { if (!logsByTag.containsKey(tag)) { itemList = new ConcurrentLinkedQueue<>(); logsByTag.put(tag, itemList); } else { itemList = logsByTag.get(tag); } } itemList.add(item); logs.add(item); return 0; }
private static synchronized void addLog(int level, String tag, String msg, Throwable throwable) { if (stream != null) { logToStream(stream, level, tag, msg, throwable); } LogItem item = new LogItem(level, tag, msg, throwable); List<LogItem> itemList; if (!logsByTag.containsKey(tag)) { itemList = new ArrayList<>(); logsByTag.put(tag, itemList); } else { itemList = logsByTag.get(tag); } itemList.add(item); logs.add(item); }
private static synchronized void addLog(int level, String tag, String msg, Throwable throwable) { if (stream != null) { logToStream(stream, level, tag, msg, throwable); } LogItem item = new LogItem(level, tag, msg, throwable); List<LogItem> itemList; if (!logsByTag.containsKey(tag)) { itemList = new ArrayList<>(); logsByTag.put(tag, itemList); } else { itemList = logsByTag.get(tag); } itemList.add(item); logs.add(item); }
private static void addLog(int level, String tag, String msg, Throwable throwable) { if (stream != null) { logToStream(stream, level, tag, msg, throwable); } LogItem item = new LogItem(level, tag, msg, throwable); Queue<LogItem> itemList; synchronized (logsByTag) { if (!logsByTag.containsKey(tag)) { itemList = new ConcurrentLinkedQueue<>(); logsByTag.put(tag, itemList); } else { itemList = logsByTag.get(tag); } } itemList.add(item); logs.add(item); }
private static int addLog(int level, String tag, String msg, Throwable throwable) { if (stream != null) { logToStream(stream, level, tag, msg, throwable); } LogItem item = new LogItem(level, tag, msg, throwable); Queue<LogItem> itemList; synchronized (logsByTag) { if (!logsByTag.containsKey(tag)) { itemList = new ConcurrentLinkedQueue<>(); logsByTag.put(tag, itemList); } else { itemList = logsByTag.get(tag); } } itemList.add(item); logs.add(item); return 0; }