Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shhhh logs #276

Merged
merged 1 commit into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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