From 739279d3e319d6e810224bbe838d2493c9f1bf22 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Fri, 26 Jul 2024 18:19:08 +0100 Subject: [PATCH] add logs --- .../new-publication/new-publication.page.ts | 11 ++++++++++- .../view-publications/view-publications.page.ts | 2 -- src/app/services/monitoring/opentelemetry/tracer.ts | 2 +- version/git-version.ts | 12 ++++++------ 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/app/pages/publications/new-publication/new-publication.page.ts b/src/app/pages/publications/new-publication/new-publication.page.ts index ba8df922d..4e9dae225 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.ts +++ b/src/app/pages/publications/new-publication/new-publication.page.ts @@ -28,6 +28,7 @@ import { PublicationAttachmentEntity } from 'src/app/shared/publication/upload/u import { PublicationFromMvService } from "src/app/shared/publication/upload/publication-from-mv.service" import { CropImagePage } from 'src/app/modals/crop-image/crop-image.page'; +import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; const config = { quality: 0.5, @@ -749,7 +750,9 @@ export class NewPublicationPage implements OnInit { } - loadVideoAndroid(resultUrl, element) { + + @XTracerAsync({name:'new-publication-mobile/gallery', bugPrint: true, autoFinish: true}) + loadVideoAndroid(resultUrl, element, tracing?: TracingType) { Filesystem.readFile({ path: resultUrl }) .then(async (content) => { @@ -758,6 +761,7 @@ export class NewPublicationPage implements OnInit { if (this.removeTextBeforeSlash(element.mimeType, '/') == "mp4") { + tracing.log("capture file from gallery", { base64: content.data }) const newAttachment = new PublicationAttachmentEntity( { base64: content.data, @@ -770,9 +774,14 @@ export class NewPublicationPage implements OnInit { newAttachment.needUpload() this.PublicationFromMvService.form.Files.push(newAttachment) + tracing.setAttribute('outcome','success') + tracing.finish() + } else { this.capturedImage = 'data:image/jpeg;base64,' + content.data; this.showCroppModal() + tracing.hasError('failed to capture file from gallery') + tracing.finish() /* const newAttachment = new PublicationAttachmentEntity( { base64: 'data:image/jpeg;base64,' + content.data, diff --git a/src/app/pages/publications/view-publications/view-publications.page.ts b/src/app/pages/publications/view-publications/view-publications.page.ts index 6093d22b6..a1d76bf95 100644 --- a/src/app/pages/publications/view-publications/view-publications.page.ts +++ b/src/app/pages/publications/view-publications/view-publications.page.ts @@ -72,11 +72,9 @@ export class ViewPublicationsPage implements OnInit { public ThemeService: ThemeService, private toastService: ToastService, public p: PermissionService, - private httpErroHandle: HttpErrorHandle, private storage: Storage, public publicationFolderService: PublicationFolderService, public checkFileType: checkFileTypeService, - private publicationVideoManagerService: PublicationVideoManagerService, public stopvideoService: StopvideoService, public platform: Platform, public activeTabService: ActiveTabService, diff --git a/src/app/services/monitoring/opentelemetry/tracer.ts b/src/app/services/monitoring/opentelemetry/tracer.ts index 4bc4467cf..550e6952f 100644 --- a/src/app/services/monitoring/opentelemetry/tracer.ts +++ b/src/app/services/monitoring/opentelemetry/tracer.ts @@ -31,7 +31,7 @@ function convertAttributesToString(obj) { result[key] = JSON.stringify(obj[key], null, 2); } else { // Convert primitive values to string - result[key] = String(obj[key]); + result[key] = obj[key]; } } } diff --git a/version/git-version.ts b/version/git-version.ts index e198c7e27..1c9e3f9a8 100644 --- a/version/git-version.ts +++ b/version/git-version.ts @@ -1,11 +1,11 @@ export let versionData = { - "shortSHA": "aef52722e", - "SHA": "aef52722e878d364f129191a3188d91c2e93b924", + "shortSHA": "12edcc748", + "SHA": "12edcc7481b60fa092db21006d95a429fb8ed1c3", "branch": "feature/agenda-api-peter", "lastCommitAuthor": "'Peter Maquiran'", - "lastCommitTime": "'Fri Jul 26 17:00:06 2024 +0100'", - "lastCommitMessage": "add token login and publication hub connection", - "lastCommitNumber": "5887", - "changeStatus": "On branch feature/agenda-api-peter\nYour branch is up to date with 'origin/feature/agenda-api-peter'.\n\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: version/git-version.ts", + "lastCommitTime": "'Fri Jul 26 17:02:35 2024 +0100'", + "lastCommitMessage": "update verion", + "lastCommitNumber": "5888", + "changeStatus": "On branch feature/agenda-api-peter\nYour branch is up to date with 'origin/feature/agenda-api-peter'.\n\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/pages/publications/new-publication/new-publication.page.ts\n\tmodified: src/app/pages/publications/view-publications/view-publications.page.ts\n\tmodified: src/app/services/monitoring/opentelemetry/tracer.ts", "changeAuthor": "peter.maquiran" } \ No newline at end of file