1
0
Fork 0
forked from github/pelican
Commit graph

33 commits

Author SHA1 Message Date
Kernc
9a04ce660c Add --fatal=errors|warnings program option 2016-01-09 02:42:02 +01:00
Justin Mayer
880ba20a98 Merge pull request #1850 from ingwinlu/deprecation_warnings
Make Pelican Python 3.5 compatible
2015-11-03 07:22:12 -08:00
derwinlu
ab2eec854d Redo ANSI support detection
When using nose to directly run the test suite it 'steals' stdout per
default. This causes the old implementation of ANSI detection to error
as stdout does not have a fileno function anymore.
2015-10-22 09:45:54 +02:00
derwinlu
e50abb20b3 Add logging for warnings during test suite run
The default configuration for the warnings module changed some time ago
so we lost the ability to detect deprecation warnings and such early.

This commit sets up the test suite to redirect all warnings through our
logging system. Additionally we enable DeprecationWarnings as a default
and throw exceptions on all warnings related to pelican modules.

This enables output of warnings related to dependencies, while letting
tests only fail if the warnings are originating from pelican's source.

Also adding a test to detect if warnings cause an Exception as expected.
2015-10-22 09:45:04 +02:00
derwinlu
a69f4294bc Add ability to toggle log filter
To test the output of warning functions it can be useful to disable the
log filter, producing the expected output instead of the limited output
that is used during normal operation.
2015-10-19 16:28:47 +02:00
derwinlu
8993c55e6e fulfil pep8 standard 2015-08-17 13:34:32 +02:00
Deniz Turgut
735a4452df Fix exception logging
Adds exception type to the exception logging.
Removes the extra logging for autoreload in debug mode, since `raise`
will make it caught by the global `try/except` below and it'll be
logged there.

This replaces #1723 and also removes extra exception logging caused
in #1718.
2015-06-03 17:07:38 -04:00
Carlos E. Garcia
f5775bcba0 minor spelling fixes 2014-09-15 20:29:00 -04:00
Deniz Turgut
ed3209888a Refactor logging handling
Old system was using manual string formatting for log messages.
This caused issues with common operations like exception logging
because often they need to be handled differently for Py2/Py3
compatibility. In order to unify the effort:

 - All logging is changed to `logging.level(msg, arg1, arg2)` style.
 - A `SafeLogger` is implemented to auto-decode exceptions properly
in the args (ref #1403).
 - Custom formatters were overriding useful logging functionality
like traceback outputing (ref #1402). They are refactored to be
more transparent. Traceback information is provided in `--debug`
mode for `read_file` errors in generators.
 - Formatters will now auto-format multiline log messages in order
to make them look related. Similarly, traceback will be formatted in
the same fashion.
 - `pelican.log.LimitFilter` was (ab)using logging message which
would result in awkward syntax for argumented logging style. This
functionality is moved to `extra` keyword argument.
 - Levels for errors that would result skipping a file (`read_file`)
changed from `warning` to `error` in order to make them stand out
among other logs.
 - Small consistency changes to log messages (i.e. changing all
to start with an uppercase letter) and quality-of-life improvements
(some log messages were dumping raw object information).
2014-07-22 12:39:39 -04:00
Justin Mayer
7e06912bca Minor text changes to log message limitation 2014-04-14 16:18:07 -04:00
Rogdham
d9b0091357 Limit and filter logs
Drop duplicates logs.
Allow for logs to be grouped, enforcing a maximum number of logs per group.
Add the LOG_FILTER setting to ask from the configuration file to ignore some
logs (of level up to warning).
2014-04-01 20:44:09 +02:00
Deniz Turgut
0548b62441 fix for issue #761: handle unicode correctly in summary for Markdown 2013-04-03 19:38:42 -04:00
Alexis Métaireau
519dcdbcb3 Manual pass on sources for better standards. 2013-03-03 20:12:31 -08:00
Dirk Makowski
71995d5e1b Port pelican to python 3.
Stays compatible with 2.x series, thanks to an unified codebase.
2013-01-11 03:20:09 +01:00
m-r-r
5aa12b2319 pelican/log.py simplified a bit 2012-03-25 18:47:14 +02:00
Andrea Crotti
0922efa371 change the way logging is done, using the standard log tree instead of
calling the module-level functions on an unitialised logging object.

This allows to
- simplify log.py
- use one logger object for each file
2012-03-20 13:01:21 +00:00
Andrea Crotti
173133dbf3 remove couple of extra spaces 2012-03-16 14:53:28 +00:00
Andrea Crotti
26078ecc17 remove unused colors and refactor more how the escaping is done 2012-03-16 14:50:26 +00:00
Andrea Crotti
2ff3db8f51 fix the reset term code to make it work also on OSX 2012-03-15 19:37:49 +00:00
Andrea Crotti
20af8fd378 refactoring of the ANSI dictionary, removing all the repeated code 2012-03-07 12:17:39 +00:00
Andrea Crotti
4eb20c5d82 global declaration is only needed if it's necessary to modify a module
level variable, to declare it and use it read only it's not necessary
2012-03-07 12:00:32 +00:00
Stéphane Raimbault
9cced6be83 Sort imports and remove trailing whitespaces 2012-02-28 17:40:13 +01:00
Skami18
3bdb1eae0b Pelican no more use ANSI codes on Windows (CMD.exe don't support it) 2011-10-14 17:21:03 +02:00
Alexis Metaireau
b7daed2ce3 Merge branch 'hacks' of https://github.com/RonnyPfannschmidt/pelican 2011-05-07 19:12:30 +01:00
Skami18
252ba7d53a pelican.log.warning added to pelican.log.__all__ 2011-05-07 18:53:10 +02:00
Ronny Pfannschmidt
0441127c41 logging star import cleanups 2011-05-06 19:23:37 +02:00
Skami18
8732569a01 Removed a bug (debug messages was not showed) and improved readability 2011-04-25 12:13:44 +02:00
Alexis Metaireau
698686e1d4 Catch all exceptions in __init__ 2011-04-20 14:44:25 +02:00
Skami18
af1bc749e1 Removed a bug related to unicode 2011-04-19 15:08:04 +02:00
Skami18
3166e6dfe3 Calls to «print» replaced by the «pelican.log» module. 2011-04-19 14:49:46 +02:00
Skami18
834c952f20 Added shortcuts functions in the `log' module 2011-04-19 11:49:24 +02:00
Skami18
c5578e338d Added a colored logging system 2011-04-18 20:14:07 +02:00
Skami18
9d10e2bff1 Added a logging system (will be useful for plugins) 2011-04-18 17:58:48 +02:00