p
This commit is contained in:
commit
beacc31ebf
@ -1 +1,7 @@
|
||||
git submodule update --init --recursive
|
||||
<<<<<<< HEAD
|
||||
git submodule update --init --recursive
|
||||
=======
|
||||
git fetch --all
|
||||
git reset --hard origin/master
|
||||
git pull
|
||||
>>>>>>> 70752a4e25d402dfc5a853164331ec9601d63a78
|
||||
|
||||
14
hp_printing/install_on_raspberyy
Normal file
14
hp_printing/install_on_raspberyy
Normal file
@ -0,0 +1,14 @@
|
||||
# install_on_raspberry
|
||||
|
||||
|
||||
## env
|
||||
|
||||
- https://developers.hp.com/hp-linux-imaging-and-printing/install/manual/distros/other
|
||||
|
||||
``` bash
|
||||
|
||||
sudo apt insatll cups
|
||||
sudo apt install libjpeg-dev
|
||||
sudo apt install libcups2-dev
|
||||
sudo apt install libusb-1.0-0-dev sane libsane-dev libdbus-1-dev
|
||||
```
|
||||
@ -41,3 +41,5 @@ trust_host_root_certs: false
|
||||
./ngrok -subdomain pub -proto=http -config=ngrok.cfg 8000
|
||||
|
||||
./ngrok -subdomain pub -proto=http -config=ngrok.cfg 22
|
||||
|
||||
screen -dmS ngrok sudo ngrok start ssh
|
||||
27
python/logging.md
Normal file
27
python/logging.md
Normal file
@ -0,0 +1,27 @@
|
||||
# logging
|
||||
|
||||
``` python
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger("simple_example")
|
||||
logger.setLevel(logging.DEBUG)
|
||||
# 建立一个filehandler来把日志记录在文件里,级别为debug以上
|
||||
fh = logging.FileHandler("spam.log")
|
||||
fh.setLevel(logging.DEBUG)
|
||||
# 建立一个streamhandler来把日志打在CMD窗口上,级别为error以上
|
||||
ch = logging.StreamHandler()
|
||||
ch.setLevel(logging.ERROR)
|
||||
# 设置日志格式
|
||||
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
|
||||
ch.setFormatter(formatter)
|
||||
fh.setFormatter(formatter)
|
||||
# 将相应的handler添加在logger对象中
|
||||
logger.addHandler(ch)
|
||||
logger.addHandler(fh)
|
||||
# 开始打日志
|
||||
logger.debug("debug message")
|
||||
logger.info("info message")
|
||||
logger.warning("warn message")
|
||||
logger.error("error message")
|
||||
logger.critical("critical message")
|
||||
```
|
||||
Loading…
x
Reference in New Issue
Block a user