* style(privilege): Fix typo 'excusive' -> 'exclusive' * style(privilege): remove unused imports * style(privilege): Fix typo 'initizalized$' -> 'initialized$' * feat(log): Add application wide logger and error handler It is help to debug electron install app on different device * feat(privilege): Add windows USB driver installation * build: I need the windows installer to test the app on windows * fix(privilege): change wdi-simpler installer to zadic * feat(log): change log level to debug in renderer process * chore: Add author in package.json * feat(privilege): Add privilege setter file as extraResource * fix(log): Allowed transport level change only in main process * fix(privilege): Fix app path calculation * fix(privilege): Take the scriptPath between double quote * build: revert the appveyor settings * refactor(privilege): Extract vendor ID, product ID and MAX_PAYLOAD_SIZE into constants file * refactor(privilege): Add both 32 and 64 bit zadics to extraResource of the installer * feat(device): Add HID API communication protocol * build: Fix npm install process * build: Fix npm install process v2 * ci: Add libudev-dev as travis apt dependencies * ci: Merge travis apt packages * ci: remove node-hid from build:usb * ci: try to fix linux build * ci: node-hid use git repo * ci: Add libusb-1.0-0-dev to travis apt dependency * feat(device): Use logging service when communicate with the device * build: create test build * build: PUBLISH_FOR_PULL_REQUEST override * build: revert TEST_BUILD to false * build: node-hid use package version instead of git repo * refactor: remove unused device store files from PR * ci: Manage test build from environment variable * fix(privilege): Set rules files dir base on dev or prod mode * fix(log): Extract nested properties of the logged object * feat(log): use util.inspect in logger service * build: upgrade @types/node-hid -> 0.5.2 * fix(device): Add extra logging when try to open device. * fix(device): log device description and not the device * fix(device): add win specific write * fix(device): add report id as first byte * style(privilege): Reformat else and comment in privilege-checker component * fix(privilege): Comment out windows branch
This commit is contained in:
committed by
László Monda
parent
84b13d3219
commit
2df8f2ea54
20
shared/src/services/logger.service.ts
Normal file
20
shared/src/services/logger.service.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import {Injectable, InjectionToken} from '@angular/core';
|
||||
|
||||
export interface ILogService {
|
||||
|
||||
error(...args: any[]): void;
|
||||
info(...args: any[]): void;
|
||||
}
|
||||
|
||||
export let LOG_SERVICE = new InjectionToken('logger-service');
|
||||
|
||||
@Injectable()
|
||||
export class ConsoleLogService implements ILogService {
|
||||
error(...args: any[]): void {
|
||||
console.error(args);
|
||||
}
|
||||
|
||||
info(...args: any[]): void {
|
||||
console.info(args);
|
||||
}
|
||||
}
|
||||
5
shared/src/util/constants.ts
Normal file
5
shared/src/util/constants.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export namespace Constants {
|
||||
export const VENDOR_ID = 0x1D50;
|
||||
export const PRODUCT_ID = 0x6122;
|
||||
export const MAX_PAYLOAD_SIZE = 64;
|
||||
}
|
||||
@@ -1,3 +1,7 @@
|
||||
import { Constants } from './constants';
|
||||
|
||||
export { Constants };
|
||||
|
||||
// Source: http://stackoverflow.com/questions/13720256/javascript-regex-camelcase-to-sentence
|
||||
export function camelCaseToSentence(camelCasedText: string): string {
|
||||
return camelCasedText.replace(/^[a-z]|[A-Z]/g, function (v, i) {
|
||||
|
||||
Reference in New Issue
Block a user