Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find functionality for log viewer #4929

Closed
nvaccessAuto opened this issue Feb 17, 2015 · 29 comments
Closed

Find functionality for log viewer #4929

nvaccessAuto opened this issue Feb 17, 2015 · 29 comments
Labels
component/NVDA-GUI enhancement good first issue github features these at https://github.com/nvaccess/nvda/contribute z goodForNewDev (archived)

Comments

@nvaccessAuto
Copy link

Reported by leonarddr on 2015-02-17 11:51
I'd like to suggest find functionality (i.e. a find dialog, find next/find previous options) for the NVDA log viewer. Now, it is actually quite hard to explore huge logs, especially when NVDA logging is set to debug and the screen reader is running for several hours. I normally copy the contents of the log viewer to notepad and search using notepad's functionality, but it shouldn't be that difficult to incorporate such functionality in NVDA.

@nvaccessAuto
Copy link
Author

Comment 2 by leonarddr on 2015-02-17 11:56
What would be the best way to start such a thing? Could the find functionality in cursorManager be used in this case, or are there more native possibilities?

@nvaccessAuto
Copy link
Author

Comment 3 by jteh on 2015-02-18 03:44
It'd be pretty tricky to use the find functionality from CursorManager, as this object isn't a CursorManager. Also, it makes sense to keep all of this logic in the GUI code rather than splitting some of it into NVDAObjects. That does, however, mean that there'll probably be some code duplication in the dialog code and in the actual search algorithm. You'll be retrieving text from and setting the caret on the output control (gui.logViewer.LogViewer.outputCtrl) directly. See textInfos.offsets.OffsetsTextInfo.find for the search code we use for most CursorManagers.

dkager added a commit to dkager/nvda that referenced this issue Nov 21, 2015
…is very similar to the find commands from cursorManager but also lets you search by regular expression. The search matches are selected like in Notepad.

The entire text buffer is searched, which may cause problems with very large logs. Another option would be to search line-by-line.
dkager added a commit to dkager/nvda that referenced this issue Nov 21, 2015
…is very similar to the find commands from cursorManager but also lets you search by regular expression. The search matches are selected like in Notepad.

The entire text buffer is searched, which may cause problems with very large logs. Another option would be to search line-by-line.
@bhavyashah
Copy link

@dkager Could you please share further updates about related implementation work you were doing almost two years ago?

@dkager
Copy link
Collaborator

dkager commented Sep 6, 2017

No, it needs code review.

@clementb49
Copy link
Contributor

Hi,
This issue is not yet solved.
I think it is an issue which allow developper to optimize there time.
Are you interested if I try to fixe this?
CC @LeonarddeR @josephsl @feerrenrut

@ruifontes
Copy link
Contributor

ruifontes commented Aug 11, 2019 via email

@XLTechie
Copy link
Contributor

XLTechie commented Aug 12, 2019 via email

@clementb49
Copy link
Contributor

I started to implement this problem, but I do not understand what is the right way to handle keyboard shortcuts in a frame or dialog box.
NVDA sometimes uses the kkey down event of wx, but this does not apply to all shortcuts in the setting dialog, for example.
In addition, there is wx.AcceleratorTable, but I do not know why NVDA does not use it.
Certainly, for now the shortcut to save the log with Ctrl + s does not work?

@Adriani90
Copy link
Collaborator

cc: @josephsl

@feerrenrut
Copy link
Contributor

I argue that there are better standalone tools that already exist for reading / searching large text files. Building and maintaining something within NVDA is misguided effort considering all the other work there is to do. I would be more inclined to simplify the log viewer, make it friendlier for non-developers to use to provide logs / info when debugging an issue.

@XLTechie
Copy link
Contributor

XLTechie commented Aug 13, 2019 via email

@XLTechie
Copy link
Contributor

XLTechie commented Aug 14, 2019 via email

@DataTriny
Copy link
Contributor

DataTriny commented Aug 14, 2019

Hi all,
My thoughts on this one:

  • A sort of filtering capability would be more useful since you don't always know the exact message you are looking for. For example, adding tabs on the top to only show warnings, erors, etc.
  • We could also filter by source files.
  • Separating tracebacks from regular logging messages would be nice.
  • A way to easilly copy a filtered query would really come in handy, and if possible, we should warn users about password disclosure when doing so (with a "Don't show this message again" checkbox for advanced users).

Of course, I know that most of these tasks can be performed inside a text editor, but it can be tedious and I personally think that having a good log viewer is a key to success for open source projects that are constantly evolving.

@feerrenrut
Copy link
Contributor

What would simplifying look like? I'm not sure how it could get more simple than
it is now.

Rather than encouraging people to read the log in our log viewer, perhaps we launch the default associated application. It is fairly easy to associate say notepad++ with *.log viewer.

There are essentially two types of users at the moment:

  • Non-developers who are trying to either capture information for debugging. Typically this is either:
    • DevInfo for an object
    • Logs and stack traces.
      • Typically it would be best if this was zipped and the directory opened.
    • Ideally the log is first automatically scanned for the (translated) "password" text, or things that might match email addresses etc, and prompt the user to redact.
    • SOMETIMES they want to go to the effort of limiting what they collect to just the log entry for the last error that occurred
  • Developers who have much more complicated needs:
    • Search
    • Filter
    • Diff timestamps
    • Watch for updates

My argument is that we can quite easily provide a better experience for non-developers, and developers would be better served by a dedicated external tool. Especially since the requirements and workflow of each developer are largely specific to them. It might be something versatile like notepad++, or several other much more specific tools EG (No endorsement or warranty provided by me, just the results of a google search for "log viewer tool"):

Personally I use a plugin for PyCharm called 'ideolog' which basically just provides highlighting of categories. If someone really wants to do NVDA specific development, extending a preexisting open source log viewer tool would be a better option in my opinion.

@Adriani90
Copy link
Collaborator

I agree that attributing the log file to a Standard app like Notepad++ or even Notepad would be enough for a non developer. Notepad is installed on every Windows PC by Default so the user would not Need to install anything.

@clementb49
Copy link
Contributor

with hindsight I am aware that this is not really necessary, it is true that I forget the possibility of using an external log viewer.
If you want you can close this issue.

@Adriani90
Copy link
Collaborator

Before closing this issue, I wonder if there is a way to force NVDA to open the log file in Notepad? Or maybe we could add a checkbox in advanced settings pannel called "use NVDA's own log editor".

@DataTriny
Copy link
Contributor

Rather than opening the log file using Notepad, we can tell windows to open the file directly. This way, it will use the default application that is configured with .log files and ask the user for an application if it is the first time he/she tries to open a .log file.

@XLTechie
Copy link
Contributor

XLTechie commented Aug 15, 2019 via email

@Adriani90
Copy link
Collaborator

I would advice not to introduce a separate key stroke just for the developer info. This should be still part of the log file. Actually, if the log file open in Notepad or any other Editor and you search for "Developer info for navigator object" the Cursor will jump right to the developer info.

@feerrenrut
Copy link
Contributor

I wonder if an intermediate step might be to separate dev info for objects from the log entirely?

I was picturing the following:

  • Press NVDA+F1, a new window opens, containing:
    • A text area with the devinfo for the current object
    • A button to open the log with windows default viewer.
    • A button to zip up diagnostic data. This has checkboxes for
      • current log (nvda.log)
      • last log (nvda-old.log)
      • include crash dump
      • include system info.

@XLTechie
Copy link
Contributor

XLTechie commented Aug 15, 2019 via email

@lukaszgo1
Copy link
Contributor

The idea given by @feerrenrut makes a lot of sense however I personally would do it slightly differently:

  1. NVDA+f1 opens a text field with the developer info for a particular object - the dev info shouldn't be a part of the log at all.
  2. Adding additional buttons to these controls isn't needed in my view.
  3. The current 'View log' item from the tools menu should be renamed into something like open log from the current session - it would open the log file with the default application associated with .log files. If someone does it frequently it is even now possible to assign shortcut to opening log viewer.
  4. Adding the automatic export of logs is problematic mostly because it would eliminate possibility of shortening these logs - it is not possible to edit files for which NVDA still has an open handle, so in my opinion collecting logs should still be a manual process.

Just out of curiosity what you want to have included in the system info which isn't in the log already?

@Adriani90
Copy link
Collaborator

@XLTechie ok I see your Point. So that means, in @feerrenrut's proposed Approach the dev info for the current focused object is being displayed when pressing nvda+f1 but all other dev Infos are stored anywhere else? How do we make sure that the user or the non developer gets directed right to the dev info of a certain object? At least in a log file an user can search for an Action or a time stamp which Points near to the desired dev info.
I think the idea to Display a Dialog as suggested by Reef above is really good. There should be a possibility to filter dev Infos (i.e. by time stamp or by application etc).

@LeonarddeR
Copy link
Collaborator

LeonarddeR commented Aug 16, 2019 via email

@XLTechie
Copy link
Contributor

XLTechie commented Aug 16, 2019 via email

@XLTechie
Copy link
Contributor

XLTechie commented Aug 16, 2019 via email

@seanbudd seanbudd added the good first issue github features these at https://github.com/nvaccess/nvda/contribute label Apr 30, 2021
@bhavyashah
Copy link

The scope of this ticket seems to have morphed into something bigger than a Find dialog; the issue may need to be edited to reflect that. The one thought I might add is that while the Log Viewer presently shows the log from the current session to the user, it does not interface with nvda-old.log. It is not clear to me why that should remain the case, especially given that there is no documentation nor is it common knowledge that the log of the previous session can be found in %temp% (even if that was not the case, it has the same qualms as opening nvda.log through %temp%). I suggest that any simplification/redesign of NVDA's Log Viewer includes or considers future inclusion of support for nvda-old.log.

@seanbudd
Copy link
Member

seanbudd commented May 19, 2022

I suggest this long discussion to be closed, and newer issues created as result of the discussions

@nvaccess nvaccess locked and limited conversation to collaborators May 26, 2022
@seanbudd seanbudd converted this issue into discussion #13738 May 26, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
component/NVDA-GUI enhancement good first issue github features these at https://github.com/nvaccess/nvda/contribute z goodForNewDev (archived)
Projects
None yet
Development

No branches or pull requests