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

Various logs fixes #231

Merged
merged 7 commits into from
Mar 8, 2016
Merged

Various logs fixes #231

merged 7 commits into from
Mar 8, 2016

Conversation

ael-code
Copy link
Member

Various small fixes. Look at the commit history for more details.

Keep in mind that we will move soon to a more robust way for logging configuration

@boyska
Copy link
Member

boyska commented Dec 11, 2015

At a first glance, everything seems fine. Could you explain the "pin security" thing?

@ael-code
Copy link
Member Author

At a first glance, everything seems fine. Could you explain the "pin security" thing?

I don't know what it is :) , it was introduced in the newer version of werkzeug. Since It produces 2 additional lines of code and we are not going to use it, I decided to remove it.

@ael-code
Copy link
Member Author

I would like to merge this and release the 0.3 version.

@boyska
Copy link
Member

boyska commented Dec 17, 2015

I will test NOW

@boyska
Copy link
Member

boyska commented Dec 17, 2015

It does not work.

TypeError: __init__() got an unexpected keyword argument 'pin_security'

I think this is because you are using a more recent flask version than I am (I'm using Flask==0.10.1). Please resist the urge to force to require a very recent version of flask, or I'll need to create an infinite number of debian packages (see #229 and https://packages.debian.org/jessie/python-flask ).

Apart from this, I can't see what's the improvement of this PR. I don't think this is needed to release 0.3.

@ael-code ael-code added this to the 0.4 milestone Dec 17, 2015
@ael-code
Copy link
Member Author

Apart from this, I can't see what's the improvement of this PR. I don't think this is needed to release 0.3.

Ok. I've assigned this the next release.

@ael-code ael-code force-pushed the log_stuff branch 2 times, most recently from cb777ca to 7e4e04a Compare February 28, 2016 10:41
@ael-code
Copy link
Member Author

Ok, debugger pin is now documented and seems a nice feature. I've reverted 1fc91bb.

I also modified travis conf to make it run tests with different version of gevent [1.0.1, 1.0.2, 1.1rc5].

@ael-code ael-code modified the milestones: 0.3.1, 0.4 Mar 1, 2016
@boyska
Copy link
Member

boyska commented Mar 1, 2016

I am trying to review this PR.

First of all, I'd like a description on the clear advantages of this. I see some refactoring, and they seem good and I am wililng to merge them. But if there is any behavior change I'd like it to be described. I guess that the logging is somewhat "better", but could you be clearer about this?

Secondly, the pin_debugger takes two commits: one does something, the other reverts it. Can you please remove both so that the history is cleaner and shorter?

@boyska
Copy link
Member

boyska commented Mar 3, 2016

Small note (this is more of a reminder to my self than a comment to the actual code): the way you forced the gevent is not entirely correct. It works, but only because in setup.py we do not specify a version. If we were to specify a version in setup.py (as I am proposing in #254 ) that would not work. The fix is trivial: use before_script instead of before_install, as I did in #256 .

@ael-code
Copy link
Member Author

ael-code commented Mar 4, 2016

First of all, I'd like a description on the clear advantages of this. I see some refactoring, and they seem good and I am wililng to merge them. But if there is any behavior change I'd like it to be described. I guess that the logging is somewhat "better", but could you be clearer about this?

Now all the output of libreant is handled in the python-logger way this is translated in:

  • we have now an homogeneous logging
  • we could control all the loggings from a single place

Logging examples:

Previous logging

2016-03-04 04:44:47,150 [archivant] [DEBUG] initializing with this config: {"ES_HOSTS": null, "ES_INDEXNAME": "libreant", "FSDB_PATH": null}
2016-03-04 04:44:47,151 [archivant] [WARNING] It has not been set any value for FSDB_PATH, file operations will not be supported
2016-03-04 04:44:47,151 [webant] [WARNING] It has not been set any value for 'USERS_DATABASE', all operations about users will be unsupported. Are all admins.
 * Restarting with stat
2016-03-04 04:44:47,513 [archivant] [DEBUG] initializing with this config: {"ES_HOSTS": null, "ES_INDEXNAME": "libreant", "FSDB_PATH": null}
2016-03-04 04:44:47,513 [archivant] [WARNING] It has not been set any value for FSDB_PATH, file operations will not be supported
2016-03-04 04:44:47,514 [webant] [WARNING] It has not been set any value for 'USERS_DATABASE', all operations about users will be unsupported. Are all admins.
 * Debugger is active!
 * Debugger pin code: 103-075-757
Listening on http://0.0.0.0:5000/
2016-03-04 04:44:51,234 [libreantdb.api] [DEBUG] waiting for index "libreant" to be ready
2016-03-04 04:44:51,240 [libreantdb.api] [DEBUG] index "libreant" is now ready
10.10.2.2 - - [2016-03-04 04:44:51] "GET /search?q=%2A%3A%2A HTTP/1.1" 200 11850 0.109837
10.10.2.2 - - [2016-03-04 04:44:51] "GET /static/bootstrap/css/bootstrap.min.css?bootstrap=3.3.5.7 HTTP/1.1" 304 191 0.006109
10.10.2.2 - - [2016-03-04 04:44:51] "GET /static/item_list.css HTTP/1.1" 304 188 0.001848
10.10.2.2 - - [2016-03-04 04:44:51] "GET /static/bootstrap/jquery.min.js?bootstrap=3.3.5.7 HTTP/1.1" 304 190 0.001773
10.10.2.2 - - [2016-03-04 04:44:51] "GET /static/bootstrap/js/bootstrap.min.js?bootstrap=3.3.5.7 HTTP/1.1" 304 190 0.003595
10.10.2.2 - - [2016-03-04 04:44:51] "GET /static/js/ui-main.js HTTP/1.1" 304 187 0.001538

Homogeneous logging

2016-03-04 04:40:58,608 [archivant] [DEBUG] initializing with this config: {"ES_HOSTS": null, "ES_INDEXNAME": "libreant", "FSDB_PATH": null}
2016-03-04 04:40:58,609 [archivant] [WARNING] It has not been set any value for FSDB_PATH, file operations will not be supported
2016-03-04 04:40:58,609 [webant] [WARNING] It has not been set any value for 'USERS_DATABASE', all operations about users will be unsupported. Are all admins.
2016-03-04 04:40:58,630 [werkzeug] [INFO]  * Restarting with stat
2016-03-04 04:40:58,956 [archivant] [DEBUG] initializing with this config: {"ES_HOSTS": null, "ES_INDEXNAME": "libreant", "FSDB_PATH": null}
2016-03-04 04:40:58,957 [archivant] [WARNING] It has not been set any value for FSDB_PATH, file operations will not be supported
2016-03-04 04:40:58,957 [webant] [WARNING] It has not been set any value for 'USERS_DATABASE', all operations about users will be unsupported. Are all admins.
2016-03-04 04:40:58,976 [werkzeug] [WARNING]  * Debugger is active!
2016-03-04 04:40:58,977 [werkzeug] [INFO]  * Debugger pin code: 103-075-757
2016-03-04 04:40:58,991 [webant] [INFO] Listening on http://0.0.0.0:5000/
2016-03-04 04:43:47,381 [libreantdb.api] [DEBUG] waiting for index "libreant" to be ready
2016-03-04 04:43:47,396 [libreantdb.api] [DEBUG] index "libreant" is now ready
2016-03-04 04:43:47,551 [webant] [INFO] 10.10.2.2 - - [2016-03-04 04:43:47] "GET /search?q=%2A%3A%2A HTTP/1.1" 200 11850 0.235244
2016-03-04 04:43:47,576 [webant] [INFO] 10.10.2.2 - - [2016-03-04 04:43:47] "GET /static/item_list.css HTTP/1.1" 304 188 0.004779
2016-03-04 04:43:47,578 [webant] [INFO] 10.10.2.2 - - [2016-03-04 04:43:47] "GET /static/js/ui-main.js HTTP/1.1" 304 187 0.000851

Of course if you don't have gevent >= 1.1 requests logging will be in the old not-homogeneous format. But this is discovered at runtime in a transparent way.

@boyska
Copy link
Member

boyska commented Mar 4, 2016

ael:

First of all, I'd like a description on the clear advantages of this. I see some refactoring, and they seem good and I am wililng to merge them. But if there is any behavior change I'd like it to be described. I guess that the logging is somewhat "better", but could you be clearer about this?

Now all the output of libreant is handled in the python-logger way this is translated in:

  • we have now an homogeneous logging
  • we could control all the loggings from a single place

Now I see. Ok, I will test those things asap so that I can merge
everything.

boyska

@ael-code
Copy link
Member Author

ael-code commented Mar 8, 2016

Commit history cleaned:

Secondly, the pin_debugger takes two commits: one does something, the other reverts it. Can you please remove both so that the history is cleaner and shorter?

I've removed both the commit related to pin-debugger. If pin-debugger functionality is available well use it

Gevent 1.1.0 release

As stated in #259, gevent 1.1.0 as been released. In order to support the new version I did:

  • fix gevent supported version in setup.py -> [1.0.1, 1.1.0]
  • make travis-ci try to install all the stable versions in the supported range: 1.0.1, 1.0.2, 1.1.0

Prayer 🙏

Please consider merging this, it has been submitted on Dec 11, 2015 and makes our logs so sexy.

@boyska
Copy link
Member

boyska commented Mar 8, 2016

ael:

Commit history cleaned:

Secondly, the pin_debugger takes two commits: one does something, the other reverts it. Can you please remove both so that the history is cleaner and shorter?

I've removed both the commit related to pin-debugger. If pin-debugger functionality is available well use it

Gevent 1.1.0 release

As stated in #259, gevent 1.1.0 as been released. In order to support the new version I did:

  • fix gevent supported version in setup.py -> [1.0.1, 1.1.0]
  • make travis-ci try to install all the stable versions in the supported range: 1.0.1, 1.0.2, 1.1.0

But is this useful at all? What I mean is that the code related to
gevent is never run during tests, so I don't think it will be useful to
do all the unit tests with different gevent version

Prayer 🙏

Please consider merging this, it has been submitted on Dec 11, 2015 and makes our logs so sexy.

ok

boyska added a commit that referenced this pull request Mar 8, 2016
Various logs improvements and fixes
@boyska boyska merged commit 0981013 into insomnia-lab:dev Mar 8, 2016
@ael-code
Copy link
Member Author

ael-code commented Mar 8, 2016

But is this useful at all? What I mean is that the code related to gevent is never run during tests, so I don't think it will be useful to do all the unit tests with different gevent version

Yeap I know. I hope we'll be able to test it in the near future

@ael-code ael-code deleted the log_stuff branch March 18, 2016 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants