Apple的通用记录,它是愚蠢的东西,但是导入OS与导入OS.log?

发布于 2025-02-11 05:08:12 字数 588 浏览 6 评论 0原文

我使用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 the os.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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文