mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-11 17:55:53 +00:00
Control API logging using the bitcoinj.logging global property.
This commit is contained in:
parent
f97cde4c34
commit
99d155e0fe
@ -26,6 +26,7 @@ import java.security.NoSuchAlgorithmException;
|
||||
|
||||
/**
|
||||
* A collection of various utility methods that are helpful for working with the BitCoin protocol.
|
||||
* To enable debug logging from the library, run with -Dbitcoinj.logging=true on your command line.
|
||||
*/
|
||||
public class Utils {
|
||||
/** How many nanocoins there are in a BitCoin. */
|
||||
@ -33,6 +34,12 @@ public class Utils {
|
||||
/** How many nanocoins there are in 0.01 BitCoins. */
|
||||
public static final BigInteger CENT = new BigInteger("1000000", 10);
|
||||
|
||||
private static boolean logging;
|
||||
|
||||
static {
|
||||
logging = Boolean.parseBoolean(System.getProperty("bitcoinj.logging", "false"));
|
||||
}
|
||||
|
||||
/** Convert an amount expressed in the way humans are used to into nanocoins. */
|
||||
public static BigInteger toNanoCoins(int coins, int cents) {
|
||||
assert cents < 100;
|
||||
@ -159,7 +166,7 @@ public class Utils {
|
||||
|
||||
static void LOG(String msg) {
|
||||
// Set this to true to see debug prints from the library.
|
||||
if (false) {
|
||||
if (logging) {
|
||||
System.out.print("BitCoin: ");
|
||||
System.out.println(msg);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user