Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有两个包以不同的身份调用 Sys::Syslog::openlog,这导致消息以任意身份随机记录。
例如:如果导入 package1 的脚本在另一个导入 package2 的脚本之前运行,则后面的脚本的身份将保持不变。
syslog 文档说要在 syslog 之前调用 openlog,但我想知道是否应该在每次 syslog 调用之前完成而不影响性能。
什么是正确的做法?