Commit ccc82b53 authored by Felix Delattre's avatar Felix Delattre
Browse files

Add logger

parent 8221b3b4
Pipeline #17349 passed with stage
in 56 seconds
......@@ -16,9 +16,15 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
import logging
import sys
import numpy
# Add a logger printing error, warining, info and debug messages to the screen
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
logger.addHandler(logging.StreamHandler(sys.stdout))
def get_an_array(nnumbers=1):
"""This method returns a range of *N* numbers."""
......@@ -26,7 +32,15 @@ def get_an_array(nnumbers=1):
def main():
# Example logging output
# This can be either logger.error(), logger.warning(), logger.info() or logger.debug()
logger.info("betty has started")
# Call the example function
get_an_array(1)
# Leave the program
sys.exit()
......
......@@ -16,8 +16,12 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
import logging
from betty.betty import get_an_array
logger = logging.getLogger()
def test_func():
pass
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment