This commit is contained in:
light 2018-03-15 11:00:14 +08:00
commit beacc31ebf
4 changed files with 50 additions and 1 deletions

View File

@ -1 +1,7 @@
<<<<<<< HEAD
git submodule update --init --recursive
=======
git fetch --all
git reset --hard origin/master
git pull
>>>>>>> 70752a4e25d402dfc5a853164331ec9601d63a78

View 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
```

View File

@ -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
View 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")
```