This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#83) Adjust parser to use universal bazelproject file format
- Loading branch information
1 parent
22040c8
commit 0113ce8
Showing
19 changed files
with
1,674 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
...ce.b2eclipse.jdt.ls/src/main/java/com/salesforce/bazel/sdk/logging/BasicLoggerFacade.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/** | ||
* Copyright (c) 2019, Salesforce.com, Inc. All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the | ||
* following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following | ||
* disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the | ||
* following disclaimer in the documentation and/or other materials provided with the distribution. | ||
* | ||
* 3. Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products | ||
* derived from this software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, | ||
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | ||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* Copyright 2016 The Bazel Authors. All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
* | ||
*/ | ||
package com.salesforce.bazel.sdk.logging; | ||
|
||
// we will revisit this later, see https://github.com/salesforce/bazel-eclipse/issues/10 | ||
// import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* | ||
* Default facade that crudely logs to stdout/stderr. | ||
* | ||
*/ | ||
public class BasicLoggerFacade extends LoggerFacade { | ||
|
||
@Override | ||
public void error(Class<?> from, String message, Object... args) { | ||
// LoggerFactory.getLogger(from).error(message, args); | ||
System.err.println(formatMsg(from, message, args)); | ||
} | ||
|
||
@Override | ||
public void error(Class<?> from, String message, Throwable exception, Object... args) { | ||
//LoggerFactory.getLogger(from).error(message, exception, args); | ||
System.err.println(formatMsg(from, message, args)); | ||
} | ||
|
||
@Override | ||
public void warn(Class<?> from, String message, Object... args) { | ||
// LoggerFactory.getLogger(from).warn(message, args); | ||
System.out.println(formatMsg(from, message, args)); | ||
} | ||
|
||
@Override | ||
public void info(Class<?> from, String message, Object... args) { | ||
// LoggerFactory.getLogger(from).info(message, args); | ||
System.out.println(formatMsg(from, message, args)); | ||
} | ||
|
||
@Override | ||
public void debug(Class<?> from, String message, Object... args) { | ||
// LoggerFactory.getLogger(from).debug(message, args); | ||
// System.out.println(formatMsg(from, message, args)); | ||
} | ||
|
||
private String formatMsg(Class<?> from, String message, Object... args) { | ||
return "[" + from.getName() + "] " + message; | ||
} | ||
|
||
} |
81 changes: 81 additions & 0 deletions
81
...salesforce.b2eclipse.jdt.ls/src/main/java/com/salesforce/bazel/sdk/logging/LogHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/** | ||
* Copyright (c) 2019, Salesforce.com, Inc. All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the | ||
* following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following | ||
* disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the | ||
* following disclaimer in the documentation and/or other materials provided with the distribution. | ||
* | ||
* 3. Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products | ||
* derived from this software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, | ||
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | ||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* Copyright 2016 The Bazel Authors. All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
* | ||
*/ | ||
package com.salesforce.bazel.sdk.logging; | ||
|
||
/** | ||
* Helper to log messages. Doesn't cache anything but class name for common logging frameworks. This allows the | ||
* LoggerFacade to be changed and without having to constantly give the class. | ||
* | ||
* This is the preferred way to log. | ||
* | ||
* @author Blaine Buxton | ||
* | ||
*/ | ||
public class LogHelper { | ||
final Class<?> from; | ||
|
||
public static LogHelper log(Class<?> from) { | ||
return new LogHelper(from); | ||
} | ||
|
||
private LogHelper(Class<?> from) { | ||
this.from = from; | ||
} | ||
|
||
public void error(String message, Object... args) { | ||
getFacade().error(from, message, args); | ||
} | ||
|
||
public void error(String message, Throwable exception, Object... args) { | ||
getFacade().error(from, message, exception, args); | ||
} | ||
|
||
public void warn(String message, Object... args) { | ||
getFacade().warn(from, message, args); | ||
} | ||
|
||
public void info(String message, Object... args) { | ||
getFacade().info(from, message, args); | ||
} | ||
|
||
public void debug(String message, Object... args) { | ||
getFacade().debug(from, message, args); | ||
} | ||
|
||
private LoggerFacade getFacade() { | ||
return LoggerFacade.instance(); | ||
} | ||
} |
Oops, something went wrong.