Apple的通用记录,它是愚蠢的东西,但是导入OS与导入OS.log?
我使用Universal Logging,这已经困扰了我一段时间。我认识的许多开发人员和各种博客都告诉我import os.log
。
但是我认为这是错误的,因为:
- 苹果对导入的建议是仅导入顶级模块。 IE。
导入OS
。 - 当我查看标头时,所有功能和类型都位于
os
标题中,os.log
标头仅包含一些较低级别的类型。不是完整的框架。
那么,为什么导入os.log
甚至有效呢?我不是这个专家,但我认为,由于导入在c intimpt os.log
中的工作方式,实际上是在os
标题中,进而依次拉动了所有其他内容导入的标题。从而使完整的框架可用。
一些开发人员告诉我,我应该导入OS.LOG
,因为“ OS”还不够清晰,甚至有些人告诉我它包含其他“操作系统”。但是我没有找到证据。
因此,问题是 - 我只使用导入OS
我有什么权利吗?还是我找不到导入os.log
还有其他原因?
I use universal logging and this has been bugging me for a while. Many developers I know as well as and various blogs all tell me to import os.log
.
However I think that's wrong because:
- Apple's recommendation on imports is to import the top level module only. ie.
import os
. - When I look at the headers all the functions and types are in the
os
header and theos.log
header only contains a few lower level types. Not the full framework.
So why does import os.log
even work? I'm not an expert on this but I think due to the way imports work in C import os.log
is effectively pulling in the os
header and in turn all the other headers it imports. Thereby making the full framework available.
Some developers have told me that I should import os.log
because `os' is not clear enough and some have even told me it contains other "Operating System" things. But I've found not evidence of that.
So, the question is - any I right in only using import os
? Or is there some other reason to import os.log
I've not found?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论