It is a good practice to guard log statements so they are turned on during error and debugging situations only.
最佳实践应是对日志语句加以保护,使其仅在出错和进行调试的情况下打开。
For example, if you want to allow certain users to access guard points only if the users log in via SSH and Telnet, add | authenticator | in front of the login processes as shown in Listing 2.
例如,如果您希望仅允许通过ssh和telnet登录的特定用户访问保护点,那么需要在登录进程的前面添加| authenticator |,如清单2所示。
Looks for cases where the log method is called outside the guard clause.
寻找在监护子句外部调用log方法的情况。
应用推荐