stephanrauh / ngx-extended-pdf-viewer

A full-blown PDF viewer for Angular 16, 17, and beyond
https://pdfviewer.net
Apache License 2.0
481 stars 182 forks source link

Unnecessary Console Log Statements #203

Closed mircowidmer closed 4 years ago

mircowidmer commented 4 years ago

Thank you for maintaining this very cool angular pdf viewer!

Is there a way to turn off the console.log statements for production? Unfortunately, when using the ngx-extended-pdf-viewer, my log is full of console.log statements that come from the library as it seems. Is there a way to turn them off?

Examples:

Check this first

Yes, the console.log statements appear there too.

Describe the bug Is there a way to turn off the console.log statements for production? Unfortunately, when using the ngx-extended-pdf-viewer, my log is full of console.log statements that come from the library as it seems. Is there a way to turn them off?

Version info

Desktop (please complete the following information):

To Reproduce Just open https://pdfviewer.net/simple? and look into the console. It's full of "debug statements".

stephanrauh commented 4 years ago

image

stephanrauh commented 4 years ago

You're right, at least three or four of these messages are unnecessary. I'll remove them. Thanks for the hint!

mircowidmer commented 4 years ago

Thanks! In my application there are more warnings, like those for example:

Screen Shot 2020-02-04 at 09 03 19
stephanrauh commented 4 years ago

Which language are you using? I've translated the find-ignore-accents messages to the few languages I know. I'm afraid that's not much. Here's the complete list of translations: https://github.com/stephanrauh/ngx-extended-pdf-viewer/tree/master/projects/ngx-extended-pdf-viewer/src/assets/additional-locale

mircowidmer commented 4 years ago

I'm using the viewer like this:

<ngx-extended-pdf-viewer *ngIf="pdfContent"
                                 [base64Src]="pdfContent"
                                 useBrowserLocale="true"
                                 height="80vh"
                                 [showOpenFileButton]="false"
                                 [showBookmarkButton]="false"
                                 textLayer="true"></ngx-extended-pdf-viewer>

And the language of my browser is english.

stephanrauh commented 4 years ago

That's strange. The showcase at https://pdfviewer.net doesn't complains about the missing translations. Just double-checking: did you add the translation file to the index.html? Or did you add the translations manually to your project?

Otherwise, the translations should have been updated by now. Obviously, they aren't, so I'm confused. My best guess is you're using an old i18n file.

mircowidmer commented 4 years ago

It seems to be that the key "find_ignore_ascents" is missing in the viewer.properties file of version 1.8.4. I updated to the newest version ^2.0.0-alpha.2 like in your github example project and there the key is contained in the viewer.properties file for the locale en-US.

stephanrauh commented 4 years ago

Oh, you're right. According to my changelog, I've probably added the translations to version 1.8.5 - but I've forgotten to publish that version.

stephanrauh commented 4 years ago

BTW, I've just learned that the unpkg CDN is a good tool to find out things like this: https://unpkg.com/browse/ngx-extended-pdf-viewer@1.8.4/assets/locale/en-GB/viewer.properties

stephanrauh commented 4 years ago

I believe I've caught all the unnecesary log statements. But I haven't published the new version yet, so I don't close this ticket yet.

stephanrauh commented 4 years ago

I close this ticket now that I've published the new version.