Move src/logger.rs into logger/ crate to unify logging across the workspace

This commit is contained in:
Michael Vines
2018-12-14 12:36:50 -08:00
committed by Grimes
parent d45fcc4381
commit 6ac466c0a4
55 changed files with 158 additions and 178 deletions

View File

@@ -9,10 +9,10 @@ homepage = "https://solana.com/"
[dependencies]
bincode = "1.0.0"
env_logger = "0.6.0"
log = "0.4.2"
serde = "1.0.82"
serde_derive = "1.0.82"
solana-logger = { path = "../../../logger", version = "0.11.0" }
solana-sdk = { path = "../../../sdk", version = "0.11.0" }
[lib]

View File

@@ -1,7 +1,6 @@
//! The `erc20` library implements a generic erc20-like token
extern crate bincode;
extern crate env_logger;
#[macro_use]
extern crate log;
extern crate serde;
@@ -13,7 +12,6 @@ extern crate solana_sdk;
use solana_sdk::account::KeyedAccount;
use solana_sdk::native_program::ProgramError;
use solana_sdk::pubkey::Pubkey;
use std::sync::{Once, ONCE_INIT};
mod token_program;
@@ -24,9 +22,7 @@ fn entrypoint(
input: &[u8],
_tick_height: u64,
) -> Result<(), ProgramError> {
// env_logger can only be initialized once
static INIT: Once = ONCE_INIT;
INIT.call_once(env_logger::init);
solana_logger::setup();
token_program::TokenProgram::process(program_id, info, input).map_err(|err| {
error!("error: {:?}", err);