Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/logger setup #15

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open

Feature/logger setup #15

wants to merge 24 commits into from

Conversation

joyoyoyoyoyo
Copy link
Member

I have implemented a logging system.
I have two unit tests displaying how to use the logger.

Features

  • Log to standard output
  • Log to any filename
  • Specify any log level
    • For example: DEBUG, TRACE, ERROR, CRITICAL, INFO, NOTICE, WARNING
  • Loggers has the capability to combine and remove specify what to log.

Installation

  • Requires a pip install of logbook

Future

  • add .log files to the .gitignore
  • Replace print statements in code with logs
  • Include the global turn-off (possibly a settings object or .properties file)

Aside: I propose we make smaller pull requests.

Copy link
Collaborator

@andrewtran1995 andrewtran1995 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that we wanted the ability to easily configure what log level to see (perhaps from a settings file, as you note in the PR). Could this be added to this PR? I think adding .log files to the .gitignore could be straightforward too -- I can do that right after this code review.

Additionally, I think some documentation in a README or something giving a basic understanding of logbook would be helpful. That way, it would be straightforward for someone to look at that documentation and instantly use the logbook module. For example, I'm not quite sure on first glance how the application stack or thread stack works.

I like that the test cases help document how the logbook is used though -- definitely helpful, and good coverage to make sure that the logbook module we're relying on will be somewhat safe!

Good work! 👍 😄

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file seems to have sneaked in from an IDE configuration folder, and should be removed.

@@ -0,0 +1,16 @@
# Installation of Logbook
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would list this as a requirement in requirements.txt found in the root-level directory.

@@ -0,0 +1,21 @@

# make sure to sync these up with _speedups.pyx
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is _speedups.pyx?

@@ -0,0 +1,24 @@
from logbook import Logger
import unittest
#from ../Logger import Logger
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd remove this line just to keep things clean, unless it's kept in here for some reason.

self._log_handler.pop_thread()
self._logger = None

#@classmethod
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also remove these commented lines if they aren't serving a purpose.

@@ -0,0 +1,16 @@
# Installation of Logbook
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would rename this to README.md and make it a broader document. Logbook Setup could be a section, but we could also include other sections for usage, to-do's, etc.

@andrewtran1995
Copy link
Collaborator

How's progress on this going, Angel? I believe the story asked for a wrapper class to simplify our own calls to any logging functionality. Have you gotten around to implementing a wrapper class yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants