1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-07-05 10:38:30 +00:00

4.0.0-rc13.11

* Added: Debug Log generation and easy uploading for issue reports.
* Fixed: Bug with chat lines not having a state causing rendering to crash.
* Fixed: Add an error boundary around the custom FFZ Emote Menu to catch errors, displaying feedback and sending error reports rather than silently failing.
* Fixed: Typo in Fine when logging errors.
* Changed: Update chat types with the latest values from Twitch's source.
* Changed: Update the GitHub issue template with instructions on uploading logs from v4.
This commit is contained in:
SirStendec 2018-12-03 18:08:32 -05:00
parent cb2f2b19ee
commit d6504757b3
18 changed files with 413 additions and 99 deletions

View file

@ -1,5 +1,6 @@
'use strict';
import dayjs from 'dayjs';
import RavenLogger from './raven';
import Logger from 'utilities/logging';
@ -13,6 +14,8 @@ import {TranslationManager} from './i18n';
import SocketClient from './socket';
import Site from 'site';
import Vue from 'utilities/vue';
import { timeout } from './utilities/object';
import { strict } from 'assert';
class FrankerFaceZ extends Module {
constructor() {
@ -30,10 +33,11 @@ class FrankerFaceZ extends Module {
// Error Reporting and Logging
// ========================================================================
if ( ! DEBUG )
this.inject('raven', RavenLogger);
this.inject('raven', RavenLogger);
this.log = new Logger(null, null, null, this.raven);
this.log.init = true;
this.core_log = this.log.get('core');
this.log.info(`FrankerFaceZ v${VER} (build ${VER.build}${VER.commit ? ` - commit ${VER.commit}` : ''})`);
@ -61,9 +65,11 @@ class FrankerFaceZ extends Module {
this.enable().then(() => this.enableInitialModules()).then(() => {
const duration = performance.now() - start_time;
this.core_log.info(`Initialization complete in ${duration.toFixed(5)}ms.`);
this.log.init = false;
}).catch(err => {
this.core_log.error('An error occurred during initialization.', err);
this.log.init = false;
});
}
@ -72,6 +78,50 @@ class FrankerFaceZ extends Module {
}
// ========================================================================
// Generate Log
// ========================================================================
async generateLog() {
const promises = [];
for(const key in this.__modules) {
const module = this.__modules[key];
if ( module instanceof Module && module.generateLog && module != this )
promises.push((async () => {
try {
return [
key,
await timeout(Promise.resolve(module.generateLog()), 5000)
];
} catch(err) {
return [
key,
`Error: ${err}`
]
}
})());
}
const out = await Promise.all(promises);
if ( this.log.captured_init && this.log.captured_init.length > 0 ) {
const logs = [];
for(const msg of this.log.captured_init) {
const time = dayjs(msg.time).locale('en').format('H:mm:ss');
logs.push(`[${time}] ${msg.level} | ${msg.category || 'core'}: ${msg.message}`);
}
out.unshift(['initialization', logs.join('\n')]);
}
return out.map(x => {
return `${x[0]}
-------------------------------------------------------------------------------
${typeof x[1] === 'string' ? x[1] : JSON.stringify(x[1], null, 4)}`
}).join('\n\n');
}
// ========================================================================
// Modules
// ========================================================================
@ -100,7 +150,7 @@ class FrankerFaceZ extends Module {
FrankerFaceZ.Logger = Logger;
const VER = FrankerFaceZ.version_info = {
major: 4, minor: 0, revision: 0, extra: '-rc13.10',
major: 4, minor: 0, revision: 0, extra: '-rc13.11',
commit: __git_commit__,
build: __webpack_hash__,
toString: () =>