| 1 | /* |
| 2 | * Copyright (C) 2015, EfficiOS Inc., Alexandre Montplaisir <alexmonthy@efficios.com> |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by |
| 6 | * the Free Software Foundation; either version 2 of the License, or |
| 7 | * (at your option) any later version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License along |
| 15 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 17 | */ |
| 18 | |
| 19 | package org.lttng.ust.agent.integration.jul; |
| 20 | |
| 21 | import java.util.logging.Level; |
| 22 | import java.util.logging.Logger; |
| 23 | |
| 24 | /** |
| 25 | * Utility methods for JUL tests |
| 26 | */ |
| 27 | final class JulTestUtils { |
| 28 | |
| 29 | JulTestUtils() { |
| 30 | } |
| 31 | |
| 32 | static void send10EventsTo(Logger logger) { |
| 33 | String a = new String("a"); |
| 34 | Object[] params = { a, new String("b"), new Object() }; |
| 35 | |
| 36 | // Levels are FINE, FINER, FINEST, INFO, SEVERE, WARNING |
| 37 | logger.fine("A fine level message"); |
| 38 | logger.finer("A finer level message"); |
| 39 | logger.finest("A finest level message"); |
| 40 | logger.info("A info level message"); |
| 41 | logger.severe("A severe level message"); |
| 42 | logger.warning("A warning level message"); |
| 43 | logger.warning("Another warning level message"); |
| 44 | logger.log(Level.WARNING, "A warning message using Logger.log()"); |
| 45 | logger.log(Level.INFO, "A message with one parameter", a); |
| 46 | logger.log(Level.INFO, "A message with parameters", params); |
| 47 | } |
| 48 | } |