Skip to content

Commit

Permalink
Reduce log level (#276)
Browse files Browse the repository at this point in the history
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
  • Loading branch information
SvenDowideit authored Jul 20, 2022
1 parent e189682 commit 5043066
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/main/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ if (process.env.LOG_LEVEL) {
log.transports.console.level = process.env.LOG_LEVEL;
log.transports.ipc.level = process.env.LOG_LEVEL;
} else {
log.transports.console.level = 'silly';
log.transports.ipc.level = 'silly';
log.transports.console.level = 'info';
log.transports.ipc.level = 'info';
}

const send = (method, msg) => {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/data/accounts/accountState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export function useAccountsState() {
window.promiseIpc
.send('ACCOUNT-GetAll')
.then((ret: AccountMeta) => {
logger.info('LOADING accounts from main');
logger.verbose('LOADING accounts from main');
dispatch(
setAccount({
accounts: ret,
Expand Down
36 changes: 20 additions & 16 deletions src/renderer/data/accounts/getAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,24 @@ export async function getParsedAccount(

const key = new sol.PublicKey(pubKey);

const solAccount = await solConn.getParsedAccountInfo(key);

const response: AccountInfo = {
accountId: key,
accountInfo: solAccount.value,
pubKey,
net,
count: 0,
solDelta: 0,
maxDelta: 0,
// programID: '', // solAccount?.owner?.toString(),
};
cache.set(`${net}_${pubKey}`, response);
return response;
try {
const solAccount = await solConn.getParsedAccountInfo(key);
const response: AccountInfo = {
accountId: key,
accountInfo: solAccount.value,
pubKey,
net,
count: 0,
solDelta: 0,
maxDelta: 0,
// programID: '', // solAccount?.owner?.toString(),
};
cache.set(`${net}_${pubKey}`, response);
return response;
} catch (e) {
logger.debug(`getParsedAccountInfo(${key}): ${e}`);
return undefined;
}
}
// react-query support
// TODO: if i understood right, re-querying will make a non-blocking request, so caould be used to update on action?
Expand Down Expand Up @@ -187,7 +191,7 @@ export async function getTokenMetadata(
// const meta = metaplex.programs.metadata.Metadata.load(conn, tokenPublicKey);
return meta;
} catch (e) {
logger.error('metadata load', e);
logger.silly('metadata load', e);
}
const fake: metaplex.programs.metadata.Metadata = {};
return fake;
Expand All @@ -206,7 +210,7 @@ export async function queryTokenMetadata(
const meta = await getTokenMetadata(net, pubKey);
return meta;
} catch (e) {
logger.warn(e);
logger.silly(e);
}
// if (!meta) {
// throw Error(`tokenmetadata for ${pubKey} Not found`);
Expand Down

0 comments on commit 5043066

Please sign in to comment.