Merge branch 'develop' of https://github.com/syuilo/misskey into develop

This commit is contained in:
syuilo 2021-02-27 19:53:23 +09:00
commit cb2a9a29fe
3 changed files with 14 additions and 10 deletions

View File

@ -66,7 +66,9 @@ if (!program.quiet) {
// Display detail of uncaught exception // Display detail of uncaught exception
process.on('uncaughtException', err => { process.on('uncaughtException', err => {
try {
logger.error(err); logger.error(err);
} catch { }
}); });
// Dying away... // Dying away...

View File

@ -94,7 +94,7 @@ export default class Logger {
level === 'info' ? this.syslogClient.info : level === 'info' ? this.syslogClient.info :
null as never; null as never;
send.bind(this.syslogClient)(message); send.bind(this.syslogClient)(message).catch(() => {});
} else { } else {
const Logs = getRepository(Log); const Logs = getRepository(Log);
Logs.insert({ Logs.insert({
@ -106,7 +106,7 @@ export default class Logger {
level: level, level: level,
message: message.substr(0, 1000), // 1024を超えるとログが挿入できずエラーになり無限ループする message: message.substr(0, 1000), // 1024を超えるとログが挿入できずエラーになり無限ループする
data: data, data: data,
} as Log); } as Log).catch(() => {});
} }
} }
} }
@ -116,8 +116,10 @@ export default class Logger {
data = data || {}; data = data || {};
data.e = x; data.e = x;
this.log('error', x.toString(), data, important); this.log('error', x.toString(), data, important);
} else if (typeof x === 'object') {
this.log('error', `${(x as any).message || (x as any).name || x}`, data, important);
} else { } else {
this.log('error', x, data, important); this.log('error', `${x}`, data, important);
} }
} }

View File

@ -11351,14 +11351,14 @@ xtend@^4.0.0, xtend@~4.0.0, xtend@~4.0.1:
integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==
y18n@^3.2.1: y18n@^3.2.1:
version "3.2.1" version "3.2.2"
resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.2.tgz#85c901bd6470ce71fc4bb723ad209b70f7f28696"
integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= integrity sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==
y18n@^4.0.0: y18n@^4.0.0:
version "4.0.0" version "4.0.1"
resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.1.tgz#8db2b83c31c5d75099bb890b23f3094891e247d4"
integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== integrity sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==
y18n@^5.0.5: y18n@^5.0.5:
version "5.0.5" version "5.0.5"