Commit Graph

58 Commits

Author SHA1 Message Date
Takashi Kajinami b977cb9bec Remove implementation for watch_log_file
... and raise an exception when the feature is explicitly requested.

The feature has been broken for some time, and depends on pyinotify
library which has been unmaintained for long time and is not compatible
with python 3.12 (because it uses asyncore).

Related-Bug: #1740111
Closes-Bug: #2059855
Change-Id: I209b1260ed4de64cbfc561a1da81a66f7a5ea397
2024-04-19 12:36:43 +00:00
xuanyandong 333e9ee27e remove unicode from code
Change-Id: I4e4e6fc55053e9d524620022af442f1313a97446
2021-01-03 16:09:31 +08:00
Hervé Beraud ad42c89f3b Adding pre-commit
Introduced changes:
- pre-commit config and rules.
- Add pre-commit to pep8 gate, Flake8 is covered in the pre-commit hooks.
- Applying fixes for pre-commit compliance in all code.

Also commit hash will be used instead of version tags in pre-commit to
prevend arbitrary code from running in developer's machines.

pre-commit will be used to:
- trailing whitespace;
- Replaces or checks mixed line ending (mixed-line-ending);
- Forbid files which have a UTF-8 byte-order marker
  (check-byte-order-marker);
- Checks that non-binary executables have a proper
  shebang (check-executables-have-shebangs);
- Check for files that contain merge conflict strings
  (check-merge-conflict);
- Check for debugger imports and py37+ breakpoint()
  calls in python source (debug-statements);
- Attempts to load all yaml files to verify syntax (check-yaml);
- Run flake8 checks (flake8) (local)

For further details about tests please refer to:
https://github.com/pre-commit/pre-commit-hooks

Change-Id: I6663d5e0866e03f8eb8c0543d3e3e0bbfb2399ac
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-08 14:21:18 +02:00
Zuul 3bf223df99 Merge "Add release notes links to doc index" 2020-05-26 13:37:47 +00:00
Andreas Jaeger 229b05b829 Switch to newer openstackdocstheme and reno versions
Switch to openstackdocstheme 2.2.1 and reno 3.1.0 versions. Using
these versions will allow especially:
* Linking from HTML to PDF document
* Allow parallel building of documents
* Fix some rendering problems

Update Sphinx version as well.

Remove these requirements from lower-constraints, they are not needed
during installation.

openstackdocstheme renames some variables, so follow the renames. A
couple of variables are also not needed anymore, remove them.

Change pygments_style to 'native' since old theme version always used
'native' and the theme now respects the setting and using 'sphinx' can
lead to some strange rendering.

See also
http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html

Change-Id: I26d5cf722635d12c3cdfde6ec25b0d3e16377b2f
2020-05-21 13:44:07 +00:00
Hervé Beraud 33b326977a Add release notes links to doc index
Change-Id: I338bf6c62c2c17c0597395a92af7f604a5fee3ee
2020-04-16 17:24:22 +02:00
Stephen Finucane 2dd526d1ed Drop python 2.7 support and testing
Ussuri Communtiy-wide goal:
https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Change-Id: If6d6357501dfdff5a5edb53f24104e216607ea00
Sem-Ver: api-break
2020-01-30 16:15:33 +01:00
caoyuan 3d4070e0fe tox: Keeping going with docs
Sphinx 1.8 introduced [1] the '--keep-going' argument which, as its name
suggests, keeps the build running when it encounters non-fatal errors.
This is exceptionally useful in avoiding a continuous edit-build loop
when undertaking large doc reworks where multiple errors may be
introduced.

[1] https://github.com/sphinx-doc/sphinx/commit/e3483e9b045

Change-Id: Icbc670ba49e0cf9e1ce33b33a16231ec64ddf042
2019-10-24 14:15:32 +08:00
pengyuesheng 9222660a46 Bump the openstackdocstheme extension to 1.20
Some options are now automatically configured by the version 1.20:
- project
- html_last_updated_fmt
- latex_engine
- latex_elements
- version
- release.

Change-Id: I61f26bed7831cdcce1f33f3981c3e97b018c4c42
2019-07-19 11:22:24 +08:00
pengyuesheng 8f1227cbd2 Blacklist sphinx 2.1.0 (autodoc bug)
See https://github.com/sphinx-doc/sphinx/issues/6440 for upstream details
Depend-On: https://review.opendev.org/#/c/663060/

Change-Id: Ic5fe18b6c0b0b59310b0adbf05c2d6583ff759f4
2019-07-05 09:51:40 +08:00
Ben Nemec e7a680e4d0 Remove incubator migration docs
Incubator logging has been gone for years. Nobody still needs these
docs, and on the off chance that I'm wrong they're still available
in git.

Change-Id: I4757f93c4194bd821232a2f6cc9abf3be00f15d0
2019-06-26 14:20:12 +00:00
Adam Spiers 57507a59ff Add logging guidelines based on previous spec
Convert the logging guidelines from the previous cross-project spec:

  https://specs.openstack.org/openstack/openstack-specs/specs/log-guidelines.html

so that they read as documentation rather than a spec, in order to
encourage developers down the right lines.

Also port a section on variable interpolation from oslo.i18n.  It was
misplaced there because it wasn't specific to i18n, and anyway logs
are no longer translated so it had to be removed from there by
Ib86013ff5e7b.

Change-Id: I3b8299b7a53e9e22c507930aa7a37c81ebcd580e
2019-06-13 17:43:30 +01:00
Adam Spiers 362fdbbf4b Fix guidelines w.r.t. translation of log messages
Translation of log messages was ceased starting with Pike, but only
the oslo.i18n documentation was only partially updated (by
Ia34ad79ca9), and not this repository.

So remove misleading examples of log translation from this
documentation.

Change-Id: Ib86013ff5e7bd07ddc696da2e4c56ce9d07f0cb6
2019-06-12 11:54:32 +01:00
Stephen Finucane 8c5317152b Avoid tox_install.sh for constraints support
We do not need tox_install.sh, pip can handle constraints itself
and install the project correctly. Thus update tox.ini and remove
the now obsolete tools/tox_install.sh file.

This follows https://review.openstack.org/#/c/508061 to remove
tools/tox_install.sh.

Change-Id: I67c50430ced6efcc2f29ec7d8adc871415922d6f
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2019-05-14 18:47:48 +02:00
Natal Ngétal 1d4c0f42f9 Cap bandit below 1.6.0 version and update sphinx and limit monotonic.
Bandit 1.6.0 accidentally changed how to exclusion list option is
handled and breaks our use of it. Cap to the previous version until
bandit has has fixed the problem.

Sphinx 2.0 no longer works on python 2.7, so need to start capping it
there as well.

Limit monotonic to python < 3.3 and reflect the changes to
openstack/requirements introduced
in change Ib8c1bf08f5fa7463911602b0df19315907c81e04.

Co-Authored-By: Stephen Finucane <sfinucan@redhat.com>
Co-Authored-By: Hervé Beraud <hberaud@redhat.com>

Change-Id: I4c2a19fae55e8cfea2d5ae9603a1fb086b5db1bf
2019-05-14 18:42:13 +02:00
jacky06 815df26f0d Replace git.openstack.org URLs with opendev.org URLs
Change-Id: I35110a02e8b16f9c1d3b44441409db990eb1a23f
2019-04-30 13:38:11 +08:00
Zuul 4a00a64a92 Merge "Advancing the protocal of the website to HTTPS in usage.rst." 2018-12-07 17:39:44 +00:00
Ben Nemec 8db5661b05 Fix up nits in log rotation change
Just a couple of doc things that became out of date due to some
code changes during the review process.

Change-Id: I5820f7940d8d32546174da132db5be5a209a2200
2018-11-29 20:50:13 +00:00
Daniel Vincze 22e8a347c8 Add config options for log rotation
On Windows, in-use files cannot be moved or deleted. For this reason,
we need the service itself to take care of rotating logs.

For convenience reasons, we're exposing the built-in rotating log
handlers through a set of config options.

More specifically, we're adding the following new config options:
- log_rotate_interval
- log_rotate_interval_type
- max_logfile_count
- max_logfile_size_mb

Change-Id: I01db4efc08e2cb64db9cbf793f3a159f54859fe7
Closes-Bug: #1802262
2018-11-21 13:46:14 +02:00
zhouxinyong 4293cd8fc5 Advancing the protocal of the website to HTTPS in usage.rst.
Change-Id: Ibca48daefc917daed3f3f2a83c6d3c4973087289
2018-11-14 02:28:05 +08:00
ZhongShengping fa12452bbd Follow the new PTI for document build
For compliance with the Project Testing Interface as described in:

https://governance.openstack.org/tc/reference/project-testing-interface.html

For more detials information, please refer to:

http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html

Change-Id: I10537cf02d83f127b6932fa3f427043fb267d8b1
Co-Authored-By: Stephen Finucane <sfinucan@redhat.com>
2018-08-10 16:01:51 -04:00
Stephen Finucane 33b5b3fc47 Fix file permissions
Change-Id: Iee0fbda6a167e5931d4778277a78da48debc84dd
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2018-05-03 10:16:08 +01:00
melissaml e5ace39499 Trivial: Update pypi url to new url
Pypi url changed from [1] to [2]

[1] https://pypi.python.org/pypi/<package>
[2] https://pypi.org/project/<package>

Change-Id: Ia29e0eaeab7b250ce1d0bd91a3f12642b6bd551c
2018-04-27 19:54:15 +00:00
lingyongxu 71537882e7 Update the documentation link for doc migration
This patch is proposed according to the Direction 10 of doc
migration(https://etherpad.openstack.org/p/doc-migration-tracking).

Change-Id: I93d6f470f3a271dc33194aea0518ac9e3531153d
2017-08-28 16:53:11 +08:00
ChangBo Guo(gcb) b4fd0d1632 Add missing variable html_last_updated_fmt
It shows 'UPDATED: NONE' without setting variable html_last_updated_fmt

Change-Id: I43f63cd2ef3c3e33986ac064897faac3a387152a
2017-07-11 22:44:42 +08:00
Doug Hellmann 6e7b87c776 switch from oslosphinx to openstackdocstheme
Depends-On: Ifc5512c0e2373cf3387e0e0498268eab092e52bb
Change-Id: I890bc443bf07a4570c907668288176ff2411e4ed
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-06-27 17:18:33 -04:00
Doug Hellmann 0fd6b61d4f rearrange content to fit the new standard layout
Change-Id: Ic218b63c96d43c3c08744f18e0e0d56dd381987c
Depends-On: Ia750cb049c0f53a234ea70ce1f2bbbb7a2aa9454
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-06-27 17:18:19 -04:00
Doug Hellmann 0defdcff96 improve the documentation for log format strings
Incorporate some of the information from the upstream docs here and add
information about a few of our custom message parameters.

Change-Id: Ib6f934e7f5d6e43afa8021241f92000c644c5e6d
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-05-15 16:31:43 -04:00
Monty Taylor a5ee482cee
Add additional info like python-systemd does
Upstream python-systemd has a journald logging handler that also adds
some exception information, as well as thread information.

  https://github.com/systemd/python-systemd/blob/master/systemd/journal.py#L581-L589

While OpenStack doesn't use a lot of threads, we might as well support it
since it's no cost. Also, add PROCESS_NAME just to be compatible with
other programs that might use python journald logging. Not entirely sure
if record.processName and the results of our self.binary_name will be
different.

The exception info is the fun stuff though.

Change-Id: Ibf0d7dae7587639737e0327f0338f30cdfc6aba1
2017-04-19 09:44:19 -05:00
Sean Dague 9525631a8e Documentation for journal usage
This adds documentation and the release not for systemd journal
support in oslo.log.

Change-Id: I91157749ddc3029af0d4df101db4d09661a2cd2f
2017-04-06 14:41:44 -04:00
Masaki Matsushita 62ba713e3b Implement FluentFormatter
This change implements FluentFormatter, a formatter for fluentd.
It enables oslo_log to output logs to fluentd directly.
FluentFormatter expects it will be used by fluent.handler.FluentHandler.

DocImpact
Implements: blueprint fluent-formatter
Change-Id: I67be5079f9370e93e5e3d4c715d2b8011154a2ce
2016-09-14 17:24:21 +09:00
Atsushi SAKAI 3fa753d752 Fix typos
osli        => oslo
respository => repository
demostrates => demonstrates

Change-Id: I76badc9f5852fafaff627770b11c5948ae1cffd7
2016-08-23 12:39:13 +00:00
liangjingtao c426a42ccd Replace "LOG.exception(_" with "LOG.exception(_LE"
Follow http://docs.openstack.org/developer/oslo.i18n/guidelines.html:
If a common message is not being used, they should each betreated
separately with respect to choosing a marker function.So this patch
is to fix it.

Change-Id: I07945d82320d9faf6dc452d49722af610330b441
Closes-Bug: #1600788
2016-07-11 20:13:38 +08:00
Edan David 3e3471fc87 Fix typo: 'Olso' to 'Oslo'
Change-Id: I0fe4ae23bf6fe7e01b6e935a6c766141393fc805
2016-06-01 02:17:56 -04:00
yan.haifeng c63991fb4d Fix example issue
example LOG.exception("An Exception occurred") in both usage.py,
usage_helper.py and usage_i18n.py failed when use py34.

fix it by raising exception before calling LOG.exception().

Change-Id: I2b6ea35fbf171232fea0cc54265f8be3dc61457f
Closes-Bug: #1578071
2016-05-05 09:30:17 +08:00
Ronald Bradford 880304818d Fix broken links in docs usage page
Change-Id: I6f7cfcb8e1ac3dab62584916d6c4ae755fe6ddf4
2016-03-04 21:12:45 +00:00
venkatamahesh 2057faf9e5 Fix spell typos
Change-Id: Ice2fcfa5e4e564c59e71b2fe8a9a453bbca04abc
2016-02-04 20:53:04 +05:30
Ronald Bradford 77d2c4def4 Improve Logging docs with inline examples and context example
Also cleaned up set_default example syntax, to help other projects
to implement consistently. Ensured example code passed flake8.
Created a dedicated examples page and applicable links to enable
viewing and download capability of examples.

Change-Id: Idd16321110df824dc89faf86a2cf9f47f38d1f4f
Depends-on: I6f92b525c6d0bdf71b01d3ac89d537b458d17e6f
2016-01-15 20:02:09 +00:00
Ronald Bradford 185c10a36b Improve documentataion of Oslo Log Usage
Added examples to explain how to implement Oslo Logging
and to show how it interacts with Oslo Config and i18n.

Revised configuration option help (and order) to provide a better
documented Configuration Options page

Change-Id: Idf4a8788f887ba07fe1b3604e06b165366b2c808
2016-01-11 17:46:39 +00:00
Davanum Srinivas 8ad1403d8f Allow oslo.log to work on non-linux platforms
Especially needed for all the HyperV work on windows.

Depends-On: I1a0a2dacbefa548296a6cfef1663ea9d48253c0c
Change-Id: Ifcc854e6eb6f4d0e575d1489f0d00f3339705e0b
2015-10-12 17:39:05 -04:00
Jenkins fa9a7b8088 Merge "Make doc title consistent with readme" 2015-09-25 11:17:25 +00:00
Jenkins ea55e53219 Merge "add documentation with example of an external configuration file" 2015-09-25 11:17:23 +00:00
Jenkins 930af4d30d Merge "add auto-generated docs for config options" 2015-09-25 11:17:17 +00:00
Doug Hellmann 369c6f8d7c Make doc title consistent with readme
Change-Id: If75a736064425c8805408b8c38dcd71e928595f6
2015-09-24 20:47:52 +00:00
Doug Hellmann 4c749ccaaa add documentation with example of an external configuration file
Change-Id: I5f0af721e6a6b4c540a0b0b40496f441fa10b18f
2015-09-24 19:36:08 +00:00
Doug Hellmann ea7eaa4b06 add auto-generated docs for config options
Add automatically generated documentation for the configuration options
using oslo_config.sphinxext.

Change-Id: I8a58303b09aa5b0c04c083c85d50b87e3efe28e0
2015-09-24 19:33:31 +00:00
Mark Doffman 362f329bcf Add optional 'fixture' dependencies.
Add extra 'fixture' section so that projects needing to use
oslo_log.fixture can add 'oslo.log [fixture]' to their
requirements to install the fixture dependencies

Closes-Bug: #1493976
Change-Id: I67f3f59c50627a41b672928d037a7bd9997caa11
2015-09-22 13:03:10 -05:00
Sean McGinnis f718919c45 Fix poor examples of exception logging
There were several examples showing passing an
exception in as the message text to a call to
LOG.exception. LOG.exception will automatically
log the exception details, so doing something
like this results in the exception information
being written out twice.

To prevent the possibility of someone seeing these
examples and assuming that is the correct way to
use LOG.exception, examples have been updated to
use LOG.error instead to illustrate the correct
way to pass in exceptions in the message string.

Change-Id: I582008609180a02eaff3d85bee5b5ca4381719ce
2015-08-28 08:50:26 -05:00
Doug Hellmann 3a4dc52c21 Add versionutils to API documentation
Add an automodule directive for the new module.

Clean up the existing docstring so it renders a bit more nicely.

Update the usage page to refer to the new location of versionutils.

Change-Id: Ib732509186e56ed2b39638129e2ec4272da1aa9d
2015-05-12 19:49:09 +00:00
Joshua Harlow c75016787a Add pypi download + version badges
Also makes the docs look more like the other
oslo libraries so that the content is easily readable
across projects.

Change-Id: Ic9837b59d194331c604b2ceddc118f2b1c5093f1
2015-04-07 18:21:42 -07:00