update sendxmpp-handler-for-python-logging
This commit is contained in:
1 parent
c2460a13e7
commit
b9b5fb4337
4 files changed
+29
-14
No files matched your search
@@ -271,15 +271,15 @@
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#appsendxmpp_handlerpy" class="md-nav__link">
|
||||
app/sendxmpp_handler.py
|
||||
<a href="#app__init__py" class="md-nav__link">
|
||||
app/__init__.py
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#app__init__py" class="md-nav__link">
|
||||
app/__init__.py
|
||||
<a href="#appsendxmpp_handlerpy" class="md-nav__link">
|
||||
app/sendxmpp_handler.py
|
||||
</a>
|
||||
|
||||
</li>
|
||||
@@ -477,15 +477,15 @@
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#appsendxmpp_handlerpy" class="md-nav__link">
|
||||
app/sendxmpp_handler.py
|
||||
<a href="#app__init__py" class="md-nav__link">
|
||||
app/__init__.py
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#app__init__py" class="md-nav__link">
|
||||
app/__init__.py
|
||||
<a href="#appsendxmpp_handlerpy" class="md-nav__link">
|
||||
app/sendxmpp_handler.py
|
||||
</a>
|
||||
|
||||
</li>
|
||||
@@ -515,12 +515,19 @@
|
||||
<p>date: 2020-12-19</p>
|
||||
<h2 id="sendxmpphandler-for-python-logging"><strong>SENDXMPPHandler for Python Logging</strong></h2>
|
||||
<script src="https://gist.github.com/adc541a6245d55e39edd10dab1001a88.js?file= SENDXMPPHandler.md"></script>
|
||||
<h2 id="appsendxmpp_handlerpy"><strong>app/sendxmpp_handler.py</strong></h2>
|
||||
<script src="https://gist.github.com/adc541a6245d55e39edd10dab1001a88.js?file= sendxmpp_handler.py"></script>
|
||||
<h2 id="app__init__py"><strong>app/__init__.py</strong></h2>
|
||||
<p>You may be familiar with adding a logging handler to a flask application, with something like the following in
|
||||
<code>__init__.py</code>.</p>
|
||||
<script src="https://gist.github.com/adc541a6245d55e39edd10dab1001a88.js?file=__init__.py"></script>
|
||||
<h2 id="appsendxmpp_handlerpy"><strong>app/sendxmpp_handler.py</strong></h2>
|
||||
<p>python-logging doesn't have a handler for xmpp but the handlers that are available are easy enough to
|
||||
understand if you read through them in <a href="https://github.com/python/cpython/blob/master/Lib/logging/handlers.py" target="_blank">handlers.py</a>.</p>
|
||||
<p>Using the available handlers as an example, it did not require a lot of imagination to come up with
|
||||
SENDXMPPHandler.</p>
|
||||
<script src="https://gist.github.com/adc541a6245d55e39edd10dab1001a88.js?file= sendxmpp_handler.py"></script>
|
||||
<h2 id="android-yaxim-screenshot"><strong>Android Yaxim Screenshot</strong></h2>
|
||||
<p><img alt="Yaxim Android Screenshot" src="https://gist.github.com/TrentSPalmer/adc541a6245d55e39edd10dab1001a88/raw/36f35a2d6c2c1c01633441542ff5d6ccb714c007/YaximAndroidScreenshot.png" /></p>
|
||||
<p>And this is what a flask logging error looks like on Android, in Yaxim.
|
||||
<img alt="Yaxim Android Screenshot" src="https://gist.github.com/TrentSPalmer/adc541a6245d55e39edd10dab1001a88/raw/36f35a2d6c2c1c01633441542ff5d6ccb714c007/YaximAndroidScreenshot.png" /></p>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"config":{"lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"Trent's Blog Posts By Date 2020-12-19: SENDXMPPHandler for Python Logging 2020-12-17: Instructions for Tethering From Phone 2020-12-15: LMDE4 Custom Partitions Disk Encryption 2020-06-21: Linux Move Cursor With Keyboard 2019-05-12: Simplified Raspberry Streaming 2019-04-13: Clear Linux Encrypted xfs Root 2019-03-11: Clear Linux Guest Virt Manager 2019-02-11: Faster Partitioning With sgdisk 2019-01-25: LMDE3 xfs Full Disk Encryption 2019-01-25: Rewrite Hugo Themes Report in Python Links Links","title":"Home"},{"location":"#trents-blog","text":"","title":"Trent's Blog"},{"location":"#posts-by-date","text":"2020-12-19: SENDXMPPHandler for Python Logging 2020-12-17: Instructions for Tethering From Phone 2020-12-15: LMDE4 Custom Partitions Disk Encryption 2020-06-21: Linux Move Cursor With Keyboard 2019-05-12: Simplified Raspberry Streaming 2019-04-13: Clear Linux Encrypted xfs Root 2019-03-11: Clear Linux Guest Virt Manager 2019-02-11: Faster Partitioning With sgdisk 2019-01-25: LMDE3 xfs Full Disk Encryption 2019-01-25: Rewrite Hugo Themes Report in Python","title":"Posts By Date"},{"location":"#links","text":"Links","title":"Links"},{"location":"links/","text":"Trent's Blog Links Home GitHub Twitter Facebook Trent Docs Hugo Themes Report libre_gps_parser Concise PDX Free Code Camp Challenges Device Layout Oregon Hikers' Field Guide","title":"Links"},{"location":"links/#trents-blog","text":"","title":"Trent's Blog"},{"location":"links/#links","text":"Home GitHub Twitter Facebook Trent Docs Hugo Themes Report libre_gps_parser Concise PDX Free Code Camp Challenges Device Layout Oregon Hikers' Field Guide","title":"Links"},{"location":"posts/clear-linux-encrypted-xfs-root/","text":"date: 2019-04-13T21:44:37-07:00 Nothing to-it Burger I had intended to create a technical explanation how to install Clear Linux with disk encryption, with xfs. But that turned out to be unnecessary because the latest version of the installer handles setting that up automatically. Previously, I had written down the steps needed to get LMDE 3 installed using disk encryption with xfs , which required manual intervention. And indeed, a few months ago, the Clear Linux installer only supported xfs with disk encryption if you could supply some manual intervention. However, the latest Clear Linux installer can set up disk encryption with luks and xfs, automatically. Just follow the instructions , no special skills needed.","title":"Clear Linux Encrypted xfs Root"},{"location":"posts/clear-linux-encrypted-xfs-root/#nothing-to-it-burger","text":"I had intended to create a technical explanation how to install Clear Linux with disk encryption, with xfs. But that turned out to be unnecessary because the latest version of the installer handles setting that up automatically. Previously, I had written down the steps needed to get LMDE 3 installed using disk encryption with xfs , which required manual intervention. And indeed, a few months ago, the Clear Linux installer only supported xfs with disk encryption if you could supply some manual intervention. However, the latest Clear Linux installer can set up disk encryption with luks and xfs, automatically. Just follow the instructions , no special skills needed.","title":"Nothing to-it Burger"},{"location":"posts/clear-linux-guest-virt-manager/","text":"date: 2019-03-11T01:39:09-07:00 Introduction download, convert, and resize the provided kvm-legacy image create a virtual machine and launch it from virt-manager But it\u2019s not immediately clear from the instructions if you can use virt-manager , because they recommend their script which runs qemu-system-x86_64 directly. Which is fine, but maybe you find it easier to customize the options using the virt-manager gui interface. How To Assuming you have libvirt and kvm set up with virt-manager , you can: download the clear-*-legacy-kvm.img.xz verify the checksum extract it unxz clear-*-legacy-kvm.img.xz mv clear-*-legacy-kvm.img.xz /var/lib/libvirt/images/ create a virtual machine in virt-manager using the image There is not an os template for Clear Linux, but Fedora29 works fine for me. As a bonus, virsh console is configured and ready to go. Convert Raw -> Qcow2 and Resize The image has a gpt partition table. I am not sure if that is the reason why, but fdisk does not seem to work for resizing the partition. However, parted works fine. The image download is an 8gb sparse raw image. You may wish to convert that to qcow2 and and resize before creating the virtual machine. Here is how to do that. convert the sparse raw image to qcow2 qemu-img convert -f raw -O qcow2 clear*.img clear.qcow2 resize the image to taste qemu-img resize clear.qcow2 20G create the virtual machine in virt-manager gui boot the virtual machine: virsh start clearvm log in: virsh console clearvm install a bundle which contains parted swupd bundle-add clr-instLine truncated
|
||||
{"config":{"lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"Trent's Blog Posts By Date 2020-12-19: SENDXMPPHandler for Python Logging 2020-12-17: Instructions for Tethering From Phone 2020-12-15: LMDE4 Custom Partitions Disk Encryption 2020-06-21: Linux Move Cursor With Keyboard 2019-05-12: Simplified Raspberry Streaming 2019-04-13: Clear Linux Encrypted xfs Root 2019-03-11: Clear Linux Guest Virt Manager 2019-02-11: Faster Partitioning With sgdisk 2019-01-25: LMDE3 xfs Full Disk Encryption 2019-01-25: Rewrite Hugo Themes Report in Python Links Links","title":"Home"},{"location":"#trents-blog","text":"","title":"Trent's Blog"},{"location":"#posts-by-date","text":"2020-12-19: SENDXMPPHandler for Python Logging 2020-12-17: Instructions for Tethering From Phone 2020-12-15: LMDE4 Custom Partitions Disk Encryption 2020-06-21: Linux Move Cursor With Keyboard 2019-05-12: Simplified Raspberry Streaming 2019-04-13: Clear Linux Encrypted xfs Root 2019-03-11: Clear Linux Guest Virt Manager 2019-02-11: Faster Partitioning With sgdisk 2019-01-25: LMDE3 xfs Full Disk Encryption 2019-01-25: Rewrite Hugo Themes Report in Python","title":"Posts By Date"},{"location":"#links","text":"Links","title":"Links"},{"location":"links/","text":"Trent's Blog Links Home GitHub Twitter Facebook Trent Docs Hugo Themes Report libre_gps_parser Concise PDX Free Code Camp Challenges Device Layout Oregon Hikers' Field Guide","title":"Links"},{"location":"links/#trents-blog","text":"","title":"Trent's Blog"},{"location":"links/#links","text":"Home GitHub Twitter Facebook Trent Docs Hugo Themes Report libre_gps_parser Concise PDX Free Code Camp Challenges Device Layout Oregon Hikers' Field Guide","title":"Links"},{"location":"posts/clear-linux-encrypted-xfs-root/","text":"date: 2019-04-13T21:44:37-07:00 Nothing to-it Burger I had intended to create a technical explanation how to install Clear Linux with disk encryption, with xfs. But that turned out to be unnecessary because the latest version of the installer handles setting that up automatically. Previously, I had written down the steps needed to get LMDE 3 installed using disk encryption with xfs , which required manual intervention. And indeed, a few months ago, the Clear Linux installer only supported xfs with disk encryption if you could supply some manual intervention. However, the latest Clear Linux installer can set up disk encryption with luks and xfs, automatically. Just follow the instructions , no special skills needed.","title":"Clear Linux Encrypted xfs Root"},{"location":"posts/clear-linux-encrypted-xfs-root/#nothing-to-it-burger","text":"I had intended to create a technical explanation how to install Clear Linux with disk encryption, with xfs. But that turned out to be unnecessary because the latest version of the installer handles setting that up automatically. Previously, I had written down the steps needed to get LMDE 3 installed using disk encryption with xfs , which required manual intervention. And indeed, a few months ago, the Clear Linux installer only supported xfs with disk encryption if you could supply some manual intervention. However, the latest Clear Linux installer can set up disk encryption with luks and xfs, automatically. Just follow the instructions , no special skills needed.","title":"Nothing to-it Burger"},{"location":"posts/clear-linux-guest-virt-manager/","text":"date: 2019-03-11T01:39:09-07:00 Introduction download, convert, and resize the provided kvm-legacy image create a virtual machine and launch it from virt-manager But it\u2019s not immediately clear from the instructions if you can use virt-manager , because they recommend their script which runs qemu-system-x86_64 directly. Which is fine, but maybe you find it easier to customize the options using the virt-manager gui interface. How To Assuming you have libvirt and kvm set up with virt-manager , you can: download the clear-*-legacy-kvm.img.xz verify the checksum extract it unxz clear-*-legacy-kvm.img.xz mv clear-*-legacy-kvm.img.xz /var/lib/libvirt/images/ create a virtual machine in virt-manager using the image There is not an os template for Clear Linux, but Fedora29 works fine for me. As a bonus, virsh console is configured and ready to go. Convert Raw -> Qcow2 and Resize The image has a gpt partition table. I am not sure if that is the reason why, but fdisk does not seem to work for resizing the partition. However, parted works fine. The image download is an 8gb sparse raw image. You may wish to convert that to qcow2 and and resize before creating the virtual machine. Here is how to do that. convert the sparse raw image to qcow2 qemu-img convert -f raw -O qcow2 clear*.img clear.qcow2 resize the image to taste qemu-img resize clear.qcow2 20G create the virtual machine in virt-manager gui boot the virtual machine: virsh start clearvm log in: virsh console clearvm install a bundle which contains parted swupd bundle-add clr-instLine truncated
|
||||
Binary file not shown.
Reference in new issue
Block a user