You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@liminal.apache.org by GitBox <gi...@apache.org> on 2020/12/01 17:00:39 UTC

[GitHub] [incubator-liminal] michaelloewenstein opened a new pull request #10: LIMINAL-5

michaelloewenstein opened a new pull request #10:
URL: https://github.com/apache/incubator-liminal/pull/10


   


----------------------------------------------------------------
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.

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



[GitHub] [incubator-liminal] michaelloewenstein commented on a change in pull request #10: [LIMINAL-5] change prints to log

Posted by GitBox <gi...@apache.org>.
michaelloewenstein commented on a change in pull request #10:
URL: https://github.com/apache/incubator-liminal/pull/10#discussion_r549505020



##########
File path: liminal/logging/logging_setup.py
##########
@@ -0,0 +1,34 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import logging
+from liminal.core import environment
+LIMINAL = 'liminal'
+LOGS_DIR = 'logs'
+
+def logging_initialization():
+    # TBD - rotating file handler

Review comment:
       <img width="1427" alt="Screen Shot 2020-12-28 at 23 16 03" src="https://user-images.githubusercontent.com/1331783/103246404-98423d80-4963-11eb-8adc-bc658e7c1e60.png">
   I see the logs both in the file & sysout, can u pls specify ? 




----------------------------------------------------------------
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.

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



[GitHub] [incubator-liminal] aviemzur commented on pull request #10: [LIMINAL-5] change prints to log

Posted by GitBox <gi...@apache.org>.
aviemzur commented on pull request #10:
URL: https://github.com/apache/incubator-liminal/pull/10#issuecomment-755146404


   Merged in #19 


----------------------------------------------------------------
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.

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



[GitHub] [incubator-liminal] michaelloewenstein commented on a change in pull request #10: [LIMINAL-5] change prints to log

Posted by GitBox <gi...@apache.org>.
michaelloewenstein commented on a change in pull request #10:
URL: https://github.com/apache/incubator-liminal/pull/10#discussion_r549507207



##########
File path: liminal/logging/logging_setup.py
##########
@@ -0,0 +1,34 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import logging
+from liminal.core import environment
+LIMINAL = 'liminal'

Review comment:
       Seems OK on my end. Actually there are existing files that seem to need an adjustment.
    
   <img width="1348" alt="Screen Shot 2020-12-28 at 23 33 42" src="https://user-images.githubusercontent.com/1331783/103246866-3be01d80-4965-11eb-9580-2159fc2acc7b.png">
   




----------------------------------------------------------------
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.

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



[GitHub] [incubator-liminal] aviemzur commented on a change in pull request #10: [LIMINAL-5] change prints to log

Posted by GitBox <gi...@apache.org>.
aviemzur commented on a change in pull request #10:
URL: https://github.com/apache/incubator-liminal/pull/10#discussion_r542323957



##########
File path: examples/liminal-getting-started/helloworld/hello_world.py
##########
@@ -16,14 +16,8 @@
 # specific language governing permissions and limitations
 # under the License.
 import json
-import os

Review comment:
       Why were these changes made to `hello_world.py`?

##########
File path: liminal/logging/logging_setup.py
##########
@@ -0,0 +1,34 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import logging
+from liminal.core import environment
+LIMINAL = 'liminal'

Review comment:
       make sure file passes PEP8
   If you use an IDE like PyCharm / IntelliJ it can help you format the file

##########
File path: liminal/logging/logging_setup.py
##########
@@ -0,0 +1,34 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import logging
+from liminal.core import environment
+LIMINAL = 'liminal'
+LOGS_DIR = 'logs'
+
+def logging_initialization():
+    # TBD - rotating file handler
+    # TBD - log in JSON format
+    root_logger = logging.getLogger()
+    log_formatter = logging.Formatter("%(asctime)s [%(threadName)s] [%(levelname)s]  %(message)s")
+    file_handler = logging.FileHandler("{0}/{1}/{2}.log".format(environment.get_liminal_home(), LOGS_DIR, LIMINAL))
+    file_handler.setFormatter(log_formatter)
+    root_logger.addHandler(file_handler)
+    root_logger.setLevel(logging.DEBUG)

Review comment:
       Please change log level to INFO

##########
File path: scripts/liminal
##########
@@ -33,7 +33,9 @@ from liminal.core import environment
 from liminal.core.util import files_util
 from liminal.kubernetes import volume_util
 from liminal.runners.airflow import dag
-
+from liminal.logging.logging_setup import logging_initialization
+logging_initialization()

Review comment:
       Please move line to after imports

##########
File path: liminal/logging/logging_setup.py
##########
@@ -0,0 +1,34 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import logging
+from liminal.core import environment
+LIMINAL = 'liminal'
+LOGS_DIR = 'logs'
+
+def logging_initialization():
+    # TBD - rotating file handler

Review comment:
       I see these are still TBD
   Currently I'm not seeing the log lines in sysout or in logs file
   I think for now let's just focus on sysout and not log to file

##########
File path: liminal/logging/logging_setup.py
##########
@@ -0,0 +1,34 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import logging
+from liminal.core import environment
+LIMINAL = 'liminal'
+LOGS_DIR = 'logs'
+
+def logging_initialization():
+    # TBD - rotating file handler
+    # TBD - log in JSON format
+    root_logger = logging.getLogger()
+    log_formatter = logging.Formatter("%(asctime)s [%(threadName)s] [%(levelname)s]  %(message)s")

Review comment:
       Please include filename and line number in the format




----------------------------------------------------------------
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.

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



[GitHub] [incubator-liminal] michaelloewenstein commented on a change in pull request #10: [LIMINAL-5] change prints to log

Posted by GitBox <gi...@apache.org>.
michaelloewenstein commented on a change in pull request #10:
URL: https://github.com/apache/incubator-liminal/pull/10#discussion_r549504725



##########
File path: examples/liminal-getting-started/helloworld/hello_world.py
##########
@@ -16,14 +16,8 @@
 # specific language governing permissions and limitations
 # under the License.
 import json
-import os

Review comment:
       The commented lines seemed redundant since they are not in use. if they are needed - my bad. 




----------------------------------------------------------------
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.

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



[GitHub] [incubator-liminal] aviemzur closed pull request #10: [LIMINAL-5] change prints to log

Posted by GitBox <gi...@apache.org>.
aviemzur closed pull request #10:
URL: https://github.com/apache/incubator-liminal/pull/10


   


----------------------------------------------------------------
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.

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



[GitHub] [incubator-liminal] michaelloewenstein commented on a change in pull request #10: [LIMINAL-5] change prints to log

Posted by GitBox <gi...@apache.org>.
michaelloewenstein commented on a change in pull request #10:
URL: https://github.com/apache/incubator-liminal/pull/10#discussion_r549507801



##########
File path: liminal/logging/logging_setup.py
##########
@@ -0,0 +1,34 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import logging
+from liminal.core import environment
+LIMINAL = 'liminal'
+LOGS_DIR = 'logs'
+
+def logging_initialization():
+    # TBD - rotating file handler

Review comment:
       The TBD are for future reference/work, I can remove them if you prefer. 

##########
File path: liminal/logging/logging_setup.py
##########
@@ -0,0 +1,34 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import logging
+from liminal.core import environment
+LIMINAL = 'liminal'
+LOGS_DIR = 'logs'
+
+def logging_initialization():
+    # TBD - rotating file handler

Review comment:
       The TBDs are for future reference/work, I can remove them if you prefer. 




----------------------------------------------------------------
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.

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