I am new to go and cannot really put my head around it. I want to override a func in an existing package in go "log4go" on every log4go.Error("An error") call. What is the best way to do it? If I want to enhance an existing method, what else could be the way? Please bear if its a basic question.
1条回答 默认 最新
- doujing5150 2013-08-29 11:50关注
You simply cannot do this. There is no "best way" to do something impossible.
All you have are alternatives:
- Fork log4go and patch it.
- Do not use
log4go.Error
but your own wrappermyError
which wraps around log4go's Error function. - Redesign or look for a different logging package.
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥15 一直显示正在等待HID—ISP
- ¥15 Python turtle 画图
- ¥15 关于大棚监测的pcb板设计
- ¥15 stm32开发clion时遇到的编译问题
- ¥15 lna设计 源简并电感型共源放大器
- ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
- ¥15 Vue3地图和异步函数使用
- ¥15 C++ yoloV5改写遇到的问题
- ¥20 win11修改中文用户名路径
- ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入