【发布时间】:2018-10-03 05:22:41
【问题描述】:
当我尝试将 python 日志记录与 airbrake 集成时,出现以下错误:
main.py
import pybrake
from config2.config import config
airbrake_handler = None
def filter_airbrake_msgs(notice):
if config.environment in ['production', 'staging']:
return notice
return None
def config_airbrake():
print(config.py_brake)
notifier = pybrake.Notifier(
project_id=config.py_brake.project_id,
project_key=config.py_brake.project_key
)
config_airbrake()
ENV=development python3 main.py
Error :
ERROR pybrake get_git_revision failed: [Errno 2] No such file or directory: '/user/xxx/xxx/xxx/.git/HEAD'
【问题讨论】:
-
你运行程序时发生了什么?
-
是的,它发生在我运行程序时。
-
请参阅@vladimir-mihailenco 答案,但您可以检查上一个命令的退出代码。
echo $?这应该表明这是无害的。
标签: python python-3.x python-2.7 airbrake