Skip to content

Commit

Permalink
Adding logger
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-uros committed Jul 24, 2024
1 parent cb02ab9 commit 3f96290
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
13 changes: 11 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "id-card-reader",
"productName": "id-card-reader",
"version": "1.0.14",
"version": "1.0.17",
"description": "My Electron application description",
"main": ".vite/build/main.js",
"repository": {
Expand Down Expand Up @@ -45,6 +45,7 @@
"dependencies": {
"@pdf-lib/fontkit": "^1.1.1",
"dotenv": "^16.4.5",
"electron-log": "^5.1.7",
"electron-squirrel-startup": "^1.0.1",
"jimp": "^0.22.12",
"pcsclite": "^1.0.1",
Expand Down
18 changes: 14 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,22 @@ import {PDFDocument} from 'pdf-lib'
import fontkit from '@pdf-lib/fontkit';
import Jimp from "jimp";
import * as fs from "fs";
import {updateElectronApp} from 'update-electron-app';
import {updateElectronApp, UpdateSourceType} from 'update-electron-app';
import log from 'electron-log/main';
// Handle creating/removing shortcuts on Windows when installing/uninstalling.
if (require('electron-squirrel-startup')) {
app.quit();
}

updateElectronApp()
log.info('logujem se negde')
updateElectronApp({
updateSource: {
type: UpdateSourceType.ElectronPublicUpdateService,
repo: 'dev-uros/citac-licne-karte-rs',
host: 'https://github.com'
},
updateInterval: '1 hour',
logger: log
})
const createWindow = () => {
// Create the browser window.
const mainWindow = new BrowserWindow({
Expand Down Expand Up @@ -109,6 +118,7 @@ let cardReader;

const initializeIDCardReader = async (browserWindow: BrowserWindow) => {

log.info('ulazim u citanje kartice')
pcsc = await pcsclite()


Expand Down Expand Up @@ -276,7 +286,7 @@ const initializeIDCardReader = async (browserWindow: BrowserWindow) => {

try {
allData.pdfBase64 = uint8ArrayToBase64(allData.pdf);
}catch (e) {
} catch (e) {
browserWindow.webContents.send('display-error');
reader.close()
pcsc.close()
Expand Down

0 comments on commit 3f96290

Please sign in to comment.