diff options
author | gjoranv <gv@verizonmedia.com> | 2022-01-21 23:40:20 +0100 |
---|---|---|
committer | gjoranv <gv@verizonmedia.com> | 2022-01-23 00:46:03 +0100 |
commit | ed7ed5ffc4627344ef24597946dc2b1f09a57697 (patch) | |
tree | 57b2f8c2974bb2b87ab7d99e4e39a6626a738fb1 /vespalog | |
parent | 418c89cd87e29b21bc3e1156203d79dfef1fe424 (diff) |
Deprecate c.y.log.LogLevel.
- Will remain PublicApi until Vespa 9
Diffstat (limited to 'vespalog')
7 files changed, 14 insertions, 7 deletions
diff --git a/vespalog/src/main/java/com/yahoo/log/LogLevel.java b/vespalog/src/main/java/com/yahoo/log/LogLevel.java index 602a0603bef..3129762e60e 100644 --- a/vespalog/src/main/java/com/yahoo/log/LogLevel.java +++ b/vespalog/src/main/java/com/yahoo/log/LogLevel.java @@ -1,10 +1,9 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.log; -import java.util.Collections; import java.util.HashMap; -import java.util.Map; import java.util.LinkedHashMap; +import java.util.Map; import java.util.logging.Level; @@ -31,8 +30,11 @@ import java.util.logging.Level; * * @author Bjorn Borud * @author arnej27959 + * + * @deprecated Use {@link java.util.logging.Level} instead. */ - +// TODO Vespa 9: move to non-PublicApi package +@Deprecated(since = "7") public class LogLevel extends Level { /** A map from the name of the log level to the instance */ private static final Map<String, Level> nameToLevel; diff --git a/vespalog/src/main/java/com/yahoo/log/LogMessage.java b/vespalog/src/main/java/com/yahoo/log/LogMessage.java index e5a22f81ad9..8f0deeea3c5 100644 --- a/vespalog/src/main/java/com/yahoo/log/LogMessage.java +++ b/vespalog/src/main/java/com/yahoo/log/LogMessage.java @@ -109,8 +109,9 @@ public class LogMessage if (! m.matches()) { throw new InvalidLogFormatException(msg); } - + @SuppressWarnings("deprecation") Level msgLevel = LogLevel.parse(m.group(6)); + Instant timestamp = parseTimestamp(m.group(1)); String threadProcess = m.group(3); @@ -162,6 +163,7 @@ public class LogMessage * it will return <code>null</code>. * */ + @SuppressWarnings("deprecation") public Event getEvent () throws MalformedEventException { if ((level == LogLevel.EVENT) && (event == null)) { try { diff --git a/vespalog/src/main/java/com/yahoo/log/event/Event.java b/vespalog/src/main/java/com/yahoo/log/event/Event.java index 8ec8c528db7..4346316619a 100644 --- a/vespalog/src/main/java/com/yahoo/log/event/Event.java +++ b/vespalog/src/main/java/com/yahoo/log/event/Event.java @@ -386,7 +386,9 @@ public abstract class Event implements Serializable { * the prettiest way to do it... */ private static final void log(Logger logger, Object param) { + @SuppressWarnings("deprecation") LogRecord r = new LogRecord(LogLevel.EVENT, null); + r.setParameters(new Object[] {param}); r.setLoggerName(logger.getName()); logger.log(r); diff --git a/vespalog/src/test/java/com/yahoo/log/LogLevelTestCase.java b/vespalog/src/test/java/com/yahoo/log/LogLevelTestCase.java index fe34c219e19..b377bd72f3a 100644 --- a/vespalog/src/test/java/com/yahoo/log/LogLevelTestCase.java +++ b/vespalog/src/test/java/com/yahoo/log/LogLevelTestCase.java @@ -14,6 +14,7 @@ import static org.junit.Assert.*; * * @author Bjorn Borud */ +@SuppressWarnings("deprecation") public class LogLevelTestCase { /** diff --git a/vespalog/src/test/java/com/yahoo/log/LogSetupTestCase.java b/vespalog/src/test/java/com/yahoo/log/LogSetupTestCase.java index a8dc6e3e8e9..354892e7d37 100644 --- a/vespalog/src/test/java/com/yahoo/log/LogSetupTestCase.java +++ b/vespalog/src/test/java/com/yahoo/log/LogSetupTestCase.java @@ -25,7 +25,7 @@ import static org.junit.Assert.assertTrue; * * @author Bjorn Borud */ -@SuppressWarnings("removal") +@SuppressWarnings({"deprecation", "removal"}) public class LogSetupTestCase { // For testing zookeeper log records protected static LogRecord zookeeperLogRecord; diff --git a/vespalog/src/test/java/com/yahoo/log/VespaFormatterTestCase.java b/vespalog/src/test/java/com/yahoo/log/VespaFormatterTestCase.java index 3a986ccede3..95a06ab2535 100644 --- a/vespalog/src/test/java/com/yahoo/log/VespaFormatterTestCase.java +++ b/vespalog/src/test/java/com/yahoo/log/VespaFormatterTestCase.java @@ -19,7 +19,7 @@ import static org.junit.Assert.fail; /** * @author Bjorn Borud */ -@SuppressWarnings("removal") +@SuppressWarnings({"deprecation", "removal"}) public class VespaFormatterTestCase { private String hostname; diff --git a/vespalog/src/test/java/com/yahoo/log/VespaLevelControllerRepoTest.java b/vespalog/src/test/java/com/yahoo/log/VespaLevelControllerRepoTest.java index 57f5424f4c2..83db5a027a4 100644 --- a/vespalog/src/test/java/com/yahoo/log/VespaLevelControllerRepoTest.java +++ b/vespalog/src/test/java/com/yahoo/log/VespaLevelControllerRepoTest.java @@ -18,7 +18,7 @@ import static org.junit.Assert.assertTrue; * @author Ulf Lilleengen * @since 5.1 */ -@SuppressWarnings("removal") +@SuppressWarnings({"deprecation", "removal"}) public class VespaLevelControllerRepoTest { static int findControlString(RandomAccessFile f, String s) { |