]>
git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/GenBuild/org/tianocore/build/global/GenBuildLogger.java
9bc3f2d176a80d91e889a2c9ccf475bfde4327b4
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 package org
.tianocore
.build
.global
;
22 import java
.util
.List
;
23 import java
.util
.Vector
;
25 import org
.apache
.tools
.ant
.Project
;
27 import org
.tianocore
.common
.logger
.EdkLog
;
28 import org
.tianocore
.common
.logger
.LogMethod
;
30 public class GenBuildLogger
implements LogMethod
{
31 private Project project
= null;
34 /// flag to present whether cache all msg or not
35 /// true means not to cache.
37 private boolean flag
= true;
39 private List
<String
> v
= null;
41 public GenBuildLogger (Project project
) {
42 this.project
= project
;
45 public GenBuildLogger (Project project
, boolean flag
) {
46 this.project
= project
;
50 // Only flag is false, v will be initialized and used.
53 v
= new Vector
<String
>(2048);
58 Rules: flag = true: means no cache Action: Print it to console
60 flag = false: mean cache all msg exception some special Action: loglevel
61 is EDK_ALWAYS -- Print but no cache loglevel is EDK_ERROR -- Print and
62 cache the msg others -- No print and cache the msg
64 public synchronized void putMessage(Object msgSource
, int msgLevel
,
66 if (this.project
== null) {
71 // If msgLevel is always print, then print it
74 case EdkLog
.EDK_ALWAYS
:
75 this.project
.log(msg
, Project
.MSG_INFO
);
77 case EdkLog
.EDK_ERROR
:
79 this.project
.log(msg
, Project
.MSG_ERR
);
81 this.project
.log(msg
, Project
.MSG_ERR
);
85 case EdkLog
.EDK_WARNING
:
87 this.project
.log(msg
, Project
.MSG_WARN
);
94 this.project
.log(msg
, Project
.MSG_INFO
);
99 case EdkLog
.EDK_VERBOSE
:
101 this.project
.log(msg
, Project
.MSG_VERBOSE
);
106 case EdkLog
.EDK_DEBUG
:
108 this.project
.log(msg
, Project
.MSG_DEBUG
);
116 public void flushToFile(File file
) {
118 // Sort msg and store to the file (TBD)