]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Common/EdkLogger.py
BaseTools: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / BaseTools / Source / Python / Common / EdkLogger.py
index 80697bf09b2e92240245f36d1f1f3fc2d71f2244..ae2070bebba3a7466df281dff0f3dbb7f5e28d70 100644 (file)
@@ -2,13 +2,7 @@
 # This file implements the log mechanism for Python tools.\r
 #\r
 # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+# SPDX-License-Identifier: BSD-2-Clause-Patent\r
 #\r
 \r
 ## Import modules\r
@@ -145,7 +139,7 @@ def warn(ToolName, Message, File=None, Line=None, ExtraData=None):
 \r
     _InfoLogger.log(WARN, LogText)\r
 \r
-    # Raise an execption if indicated\r
+    # Raise an exception if indicated\r
     if _WarningAsError == True:\r
         raise FatalError(WARNING_AS_ERROR)\r
 \r
@@ -155,7 +149,7 @@ info    = _InfoLogger.info
 ## Log ERROR message\r
 #\r
 #   Once an error messages is logged, the tool's execution will be broken by raising\r
-# an execption. If you don't want to break the execution later, you can give\r
+# an exception. If you don't want to break the execution later, you can give\r
 # "RaiseError" with "False" value.\r
 #\r
 #   @param  ToolName    The name of the tool. If not given, the name of caller\r
@@ -165,7 +159,7 @@ info    = _InfoLogger.info
 #   @param  File        The name of file which caused the error.\r
 #   @param  Line        The line number in the "File" which caused the warning.\r
 #   @param  ExtraData   More information associated with "Message"\r
-#   @param  RaiseError  Raise an exception to break the tool's executuion if\r
+#   @param  RaiseError  Raise an exception to break the tool's execution if\r
 #                       it's True. This is the default behavior.\r
 #\r
 def error(ToolName, ErrorCode, Message=None, File=None, Line=None, ExtraData=None, RaiseError=IsRaiseError):\r
@@ -198,8 +192,8 @@ def error(ToolName, ErrorCode, Message=None, File=None, Line=None, ExtraData=Non
         LogText = _ErrorMessageTemplateWithoutFile % TemplateDict\r
 \r
     _ErrorLogger.log(ERROR, LogText)\r
-    RaiseError = IsRaiseError\r
-    if RaiseError:\r
+\r
+    if RaiseError and IsRaiseError:\r
         raise FatalError(ErrorCode)\r
 \r
 # Log information which should be always put out\r