You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by GitBox <gi...@apache.org> on 2021/07/16 15:56:02 UTC

[GitHub] [brooklyn-server] algairim opened a new pull request #1204: Introduce lineId for log entries

algairim opened a new pull request #1204:
URL: https://github.com/apache/brooklyn-server/pull/1204


   Signed-off-by: Mykola Mandra <my...@cloudsoft.io>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-server] jcabrerizo commented on a change in pull request #1204: Introduce lineId for log entries

Posted by GitBox <gi...@apache.org>.
jcabrerizo commented on a change in pull request #1204:
URL: https://github.com/apache/brooklyn-server/pull/1204#discussion_r672129002



##########
File path: core/src/main/java/org/apache/brooklyn/util/core/logbook/file/FileLogStore.java
##########
@@ -69,23 +70,28 @@
     public final static ConfigKey<String> LOGBOOK_LOG_STORE_DATEFORMAT = ConfigKeys.newStringConfigKey(
             BASE_NAME_FILE_LOG_STORE + ".dateFormat", "Date format", "yyyy-MM-dd'T'HH:mm:ss,SSS");
 
+    public final static TimeZone UTC_TIMEZONE = TimeZone.getTimeZone("UTC");
+
     private final String filePath;
     private final Path path;
     private final String logLinePattern;
-    private final String logDateFormat;
+    private final DateFormat dateFormat;
+
 
     @VisibleForTesting
     public FileLogStore() {
         this.path = null;
         this.filePath = "";
         this.logLinePattern = LOGBOOK_LOG_STORE_REGEX.getDefaultValue();
-        this.logDateFormat = LOGBOOK_LOG_STORE_DATEFORMAT.getDefaultValue();
+        dateFormat = new SimpleDateFormat(LOGBOOK_LOG_STORE_DATEFORMAT.getDefaultValue());

Review comment:
       I'd add `this.` to dateFormat to keep it consistent 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-server] asfgit closed pull request #1204: Introduce lineId for log entries

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #1204:
URL: https://github.com/apache/brooklyn-server/pull/1204


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-server] asfgit closed pull request #1204: Introduce lineId for log entries

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #1204:
URL: https://github.com/apache/brooklyn-server/pull/1204


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-server] ahgittin commented on a change in pull request #1204: Introduce lineId for log entries

Posted by GitBox <gi...@apache.org>.
ahgittin commented on a change in pull request #1204:
URL: https://github.com/apache/brooklyn-server/pull/1204#discussion_r672175324



##########
File path: core/src/main/java/org/apache/brooklyn/util/core/logbook/file/FileLogStore.java
##########
@@ -69,23 +70,28 @@
     public final static ConfigKey<String> LOGBOOK_LOG_STORE_DATEFORMAT = ConfigKeys.newStringConfigKey(
             BASE_NAME_FILE_LOG_STORE + ".dateFormat", "Date format", "yyyy-MM-dd'T'HH:mm:ss,SSS");
 
+    public final static TimeZone UTC_TIMEZONE = TimeZone.getTimeZone("UTC");
+
     private final String filePath;
     private final Path path;
     private final String logLinePattern;
-    private final String logDateFormat;
+    private final DateFormat dateFormat;
+
 
     @VisibleForTesting
     public FileLogStore() {
         this.path = null;
         this.filePath = "";
         this.logLinePattern = LOGBOOK_LOG_STORE_REGEX.getDefaultValue();
-        this.logDateFormat = LOGBOOK_LOG_STORE_DATEFORMAT.getDefaultValue();
+        dateFormat = new SimpleDateFormat(LOGBOOK_LOG_STORE_DATEFORMAT.getDefaultValue());

Review comment:
       personally i don't like the `this.` (except where it is needed)

##########
File path: core/src/test/java/org/apache/brooklyn/util/core/logbook/file/FileLogStoreTest.java
##########
@@ -48,64 +49,74 @@
             "\tat org.apache.felix.scr.impl.ComponentRegistry.checkComponentName(ComponentRegistry.java:240) ~[?:?]\n" +
             "\tat org.apache.felix.scr.impl.BundleComponentActivator.validateAndRegister(BundleComponentActivator.java:443) ~[?:?]";
 
+    private final AtomicInteger lineCount = new AtomicInteger();
+
     @BeforeTest
     public void setUp() {
-        TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
+        TimeZone.setDefault(TimeZone.getTimeZone("UTC"));

Review comment:
       i don't like having to set this in a test but don't have a better idea so go for it




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-server] ahgittin commented on pull request #1204: Introduce lineId for log entries

Posted by GitBox <gi...@apache.org>.
ahgittin commented on pull request #1204:
URL: https://github.com/apache/brooklyn-server/pull/1204#issuecomment-882433575


   LGTM


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-server] ahgittin commented on pull request #1204: Introduce lineId for log entries

Posted by GitBox <gi...@apache.org>.
ahgittin commented on pull request #1204:
URL: https://github.com/apache/brooklyn-server/pull/1204#issuecomment-882433575


   LGTM


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-server] jcabrerizo commented on a change in pull request #1204: Introduce lineId for log entries

Posted by GitBox <gi...@apache.org>.
jcabrerizo commented on a change in pull request #1204:
URL: https://github.com/apache/brooklyn-server/pull/1204#discussion_r672129002



##########
File path: core/src/main/java/org/apache/brooklyn/util/core/logbook/file/FileLogStore.java
##########
@@ -69,23 +70,28 @@
     public final static ConfigKey<String> LOGBOOK_LOG_STORE_DATEFORMAT = ConfigKeys.newStringConfigKey(
             BASE_NAME_FILE_LOG_STORE + ".dateFormat", "Date format", "yyyy-MM-dd'T'HH:mm:ss,SSS");
 
+    public final static TimeZone UTC_TIMEZONE = TimeZone.getTimeZone("UTC");
+
     private final String filePath;
     private final Path path;
     private final String logLinePattern;
-    private final String logDateFormat;
+    private final DateFormat dateFormat;
+
 
     @VisibleForTesting
     public FileLogStore() {
         this.path = null;
         this.filePath = "";
         this.logLinePattern = LOGBOOK_LOG_STORE_REGEX.getDefaultValue();
-        this.logDateFormat = LOGBOOK_LOG_STORE_DATEFORMAT.getDefaultValue();
+        dateFormat = new SimpleDateFormat(LOGBOOK_LOG_STORE_DATEFORMAT.getDefaultValue());

Review comment:
       I'd add `this.` to dateFormat to keep it consistent 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-server] ahgittin commented on a change in pull request #1204: Introduce lineId for log entries

Posted by GitBox <gi...@apache.org>.
ahgittin commented on a change in pull request #1204:
URL: https://github.com/apache/brooklyn-server/pull/1204#discussion_r672175324



##########
File path: core/src/main/java/org/apache/brooklyn/util/core/logbook/file/FileLogStore.java
##########
@@ -69,23 +70,28 @@
     public final static ConfigKey<String> LOGBOOK_LOG_STORE_DATEFORMAT = ConfigKeys.newStringConfigKey(
             BASE_NAME_FILE_LOG_STORE + ".dateFormat", "Date format", "yyyy-MM-dd'T'HH:mm:ss,SSS");
 
+    public final static TimeZone UTC_TIMEZONE = TimeZone.getTimeZone("UTC");
+
     private final String filePath;
     private final Path path;
     private final String logLinePattern;
-    private final String logDateFormat;
+    private final DateFormat dateFormat;
+
 
     @VisibleForTesting
     public FileLogStore() {
         this.path = null;
         this.filePath = "";
         this.logLinePattern = LOGBOOK_LOG_STORE_REGEX.getDefaultValue();
-        this.logDateFormat = LOGBOOK_LOG_STORE_DATEFORMAT.getDefaultValue();
+        dateFormat = new SimpleDateFormat(LOGBOOK_LOG_STORE_DATEFORMAT.getDefaultValue());

Review comment:
       personally i don't like the `this.` (except where it is needed)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-server] ahgittin commented on a change in pull request #1204: Introduce lineId for log entries

Posted by GitBox <gi...@apache.org>.
ahgittin commented on a change in pull request #1204:
URL: https://github.com/apache/brooklyn-server/pull/1204#discussion_r672176988



##########
File path: core/src/test/java/org/apache/brooklyn/util/core/logbook/file/FileLogStoreTest.java
##########
@@ -48,64 +49,74 @@
             "\tat org.apache.felix.scr.impl.ComponentRegistry.checkComponentName(ComponentRegistry.java:240) ~[?:?]\n" +
             "\tat org.apache.felix.scr.impl.BundleComponentActivator.validateAndRegister(BundleComponentActivator.java:443) ~[?:?]";
 
+    private final AtomicInteger lineCount = new AtomicInteger();
+
     @BeforeTest
     public void setUp() {
-        TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
+        TimeZone.setDefault(TimeZone.getTimeZone("UTC"));

Review comment:
       i don't like having to set this in a test but don't have a better idea so go for it




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org