-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from ivall/debug-logging
Add debug logging capability
- Loading branch information
Showing
24 changed files
with
434 additions
and
119 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
41 changes: 41 additions & 0 deletions
41
bukkit/src/main/java/pl/vishop/plugin/bukkit/BukkitConfigLoader.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,41 @@ | ||
/* | ||
* Copyright (C) 2022 VIshop-plugin Contributors | ||
* https://github.com/ivall/VIshop-plugin/graphs/contributors | ||
* | ||
* 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 pl.vishop.plugin.bukkit; | ||
|
||
import org.bukkit.configuration.ConfigurationSection; | ||
import pl.vishop.plugin.config.ConfigLoader; | ||
|
||
public class BukkitConfigLoader implements ConfigLoader { | ||
|
||
private final ConfigurationSection configFile; | ||
|
||
public BukkitConfigLoader(final ConfigurationSection configFile) { | ||
this.configFile = configFile; | ||
} | ||
|
||
@Override | ||
public boolean getBoolean(final String key) { | ||
return this.configFile.getBoolean(key); | ||
} | ||
|
||
@Override | ||
public String getString(final String key) { | ||
return this.configFile.getString(key); | ||
} | ||
|
||
} |
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
46 changes: 46 additions & 0 deletions
46
bukkit/src/main/java/pl/vishop/plugin/bukkit/BukkitViShopLogger.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,46 @@ | ||
/* | ||
* Copyright (C) 2022 VIshop-plugin Contributors | ||
* https://github.com/ivall/VIshop-plugin/graphs/contributors | ||
* | ||
* 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 pl.vishop.plugin.bukkit; | ||
|
||
import java.util.logging.Logger; | ||
import pl.vishop.plugin.logger.ViShopLogger; | ||
|
||
public class BukkitViShopLogger implements ViShopLogger { | ||
|
||
private final Logger logger; | ||
|
||
public BukkitViShopLogger(final Logger logger) { | ||
this.logger = logger; | ||
} | ||
|
||
@Override | ||
public void info(final String message) { | ||
this.logger.info(message); | ||
} | ||
|
||
@Override | ||
public void error(final String message) { | ||
this.logger.severe(message); | ||
} | ||
|
||
@Override | ||
public void debug(final String message) { | ||
this.logger.info(String.format("[DEBUG] %s", message)); | ||
} | ||
|
||
} |
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
41 changes: 41 additions & 0 deletions
41
bungee/src/main/java/pl/vishop/plugin/bungee/BungeeConfigLoader.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,41 @@ | ||
/* | ||
* Copyright (C) 2022 VIshop-plugin Contributors | ||
* https://github.com/ivall/VIshop-plugin/graphs/contributors | ||
* | ||
* 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 pl.vishop.plugin.bungee; | ||
|
||
import net.md_5.bungee.config.Configuration; | ||
import pl.vishop.plugin.config.ConfigLoader; | ||
|
||
public class BungeeConfigLoader implements ConfigLoader { | ||
|
||
private final Configuration configFile; | ||
|
||
public BungeeConfigLoader(final Configuration configFile) { | ||
this.configFile = configFile; | ||
} | ||
|
||
@Override | ||
public boolean getBoolean(final String key) { | ||
return this.configFile.getBoolean(key); | ||
} | ||
|
||
@Override | ||
public String getString(final String key) { | ||
return this.configFile.getString(key); | ||
} | ||
|
||
} |
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
46 changes: 46 additions & 0 deletions
46
bungee/src/main/java/pl/vishop/plugin/bungee/BungeeViShopLogger.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,46 @@ | ||
/* | ||
* Copyright (C) 2022 VIshop-plugin Contributors | ||
* https://github.com/ivall/VIshop-plugin/graphs/contributors | ||
* | ||
* 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 pl.vishop.plugin.bungee; | ||
|
||
import java.util.logging.Logger; | ||
import pl.vishop.plugin.logger.ViShopLogger; | ||
|
||
public class BungeeViShopLogger implements ViShopLogger { | ||
|
||
private final Logger logger; | ||
|
||
public BungeeViShopLogger(final Logger logger) { | ||
this.logger = logger; | ||
} | ||
|
||
@Override | ||
public void info(final String message) { | ||
this.logger.info(message); | ||
} | ||
|
||
@Override | ||
public void error(final String message) { | ||
this.logger.severe(message); | ||
} | ||
|
||
@Override | ||
public void debug(final String message) { | ||
this.logger.info(String.format("[DEBUG] %s", message)); | ||
} | ||
|
||
} |
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
Oops, something went wrong.