diff options
Diffstat (limited to 'python-logging-ldp.spec')
| -rw-r--r-- | python-logging-ldp.spec | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/python-logging-ldp.spec b/python-logging-ldp.spec new file mode 100644 index 0000000..63581fa --- /dev/null +++ b/python-logging-ldp.spec @@ -0,0 +1,105 @@ +%global _empty_manifest_terminate_build 0 +Name: python-logging-ldp +Version: 0.0.6 +Release: 1 +Summary: OVH library bundle to send logs on Log Data Platform (LDP) +License: BSD +URL: https://github.com/ovh/python-logging-ldp +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/7c/d6/bfbe513cce9018287496517ca575b6e7a82bf183c6e1e07424f68d53968c/logging-ldp-0.0.6.tar.gz +BuildArch: noarch + + +%description +First, install logging-ldp using `pip <https://pip.pypa.io/en/stable/>`_:: + pip install -U logging-ldp +The following example shows how to send log in Graylog TCP input + import logging + from logging_ldp.formatters import LDPGELFFormatter + from logging_ldp.handlers import LDPGELFTCPSocketHandler + logger = logging.getLogger("ldp") + logger.setLevel(logging.DEBUG) + handler = LDPGELFTCPSocketHandler(hostname="gra1.logs.ovh.com") + handler.setFormatter(LDPGELFFormatter(token="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX")) + logger.addHandler(handler) + logger.debug("hello !") + +%package -n python3-logging-ldp +Summary: OVH library bundle to send logs on Log Data Platform (LDP) +Provides: python-logging-ldp +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-logging-ldp +First, install logging-ldp using `pip <https://pip.pypa.io/en/stable/>`_:: + pip install -U logging-ldp +The following example shows how to send log in Graylog TCP input + import logging + from logging_ldp.formatters import LDPGELFFormatter + from logging_ldp.handlers import LDPGELFTCPSocketHandler + logger = logging.getLogger("ldp") + logger.setLevel(logging.DEBUG) + handler = LDPGELFTCPSocketHandler(hostname="gra1.logs.ovh.com") + handler.setFormatter(LDPGELFFormatter(token="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX")) + logger.addHandler(handler) + logger.debug("hello !") + +%package help +Summary: Development documents and examples for logging-ldp +Provides: python3-logging-ldp-doc +%description help +First, install logging-ldp using `pip <https://pip.pypa.io/en/stable/>`_:: + pip install -U logging-ldp +The following example shows how to send log in Graylog TCP input + import logging + from logging_ldp.formatters import LDPGELFFormatter + from logging_ldp.handlers import LDPGELFTCPSocketHandler + logger = logging.getLogger("ldp") + logger.setLevel(logging.DEBUG) + handler = LDPGELFTCPSocketHandler(hostname="gra1.logs.ovh.com") + handler.setFormatter(LDPGELFFormatter(token="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX")) + logger.addHandler(handler) + logger.debug("hello !") + +%prep +%autosetup -n logging-ldp-0.0.6 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-logging-ldp -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 17 2023 Python_Bot <Python_Bot@openeuler.org> - 0.0.6-1 +- Package Spec generated |
