Skip to content
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

log failed tasks #1105

Closed
1 task
teto opened this issue May 29, 2024 · 7 comments
Closed
1 task

log failed tasks #1105

teto opened this issue May 29, 2024 · 7 comments
Labels
invalid This doesn't seem right

Comments

@teto
Copy link

teto commented May 29, 2024

Please describe the problem you're trying to solve

I am trying to implement the suggested solution #1103 so I updated to nightly yazi, doing so I noticed the "28 tasks" in taskbar. Typing w prompted the task list with this result:
image

Typing "Enter" on one of the entry I got:

Preload task failed:
error converting Lua nil to function

Would you be willing to contribute this feature?

  • Yes, I'll give it a shot

Describe the solution you'd like

I tried to get more context via less /home/teto/.local/state/yazi/yazi.log but the file remains empty (I had previously removed it).

I believe failed tasks should be logged in the log file. And maybe the UI could be improved to show more info:

  • the tasklist could show if the task is running or failed ?
  • I am not sure how the task name Run preloader 'mime' is supposed to help me.

Here is the excerpt from my config:

[plugin]
# https://yazi-rs.github.io/docs/configuration/yazi/#plugin
preloaders = [
	{ name = "*", cond = "!mime", run = "mime", multi = true, prio = "high" },
	# Image
	{ mime = "image/vnd.djvu", run = "noop" },
	{ mime = "image/*",        run = "image" },
	# Video
	{ mime = "video/*", run = "video" },
	# PDF
	{ mime = "application/pdf", run = "pdf" },
]

prepend_previewers = [
  # sync = true
  { name = "*.chunks", run = "chunks" },
  { name = "*.jsonzlib", run = "jsonzlib" },
  { mime = "audio/*", run = "zaz" },
]

is mime the name of a builtin preloader ?

Additional context

once again thanks a lot for this amazing software that never ceases to amaze me

@teto teto added the feature New feature request label May 29, 2024
@teto
Copy link
Author

teto commented May 29, 2024

Also I noticed that there were only two log levels "dbg" and "err" ? I think "warn" and "info" could be useful to help troubleshoot better the issues.

@sxyazi
Copy link
Owner

sxyazi commented May 29, 2024

Hi, this is a breaking change for the upcoming Yazi v0.3 release. Please remove the mime plugin from your preloaders. See #1046 for details.

@sxyazi sxyazi added waiting on op Waiting for more information from the original poster invalid This doesn't seem right and removed feature New feature request labels May 29, 2024
@teto
Copy link
Author

teto commented May 29, 2024

thanks it helped. I will let you close or let open depending on what you think of this part of my message

I believe failed tasks should be logged in the log file. And maybe the UI could be improved to show more info:
the tasklist could show if the task is running or failed ?
I am not sure how the task name Run preloader 'mime' is supposed to help me.

@github-actions github-actions bot removed the waiting on op Waiting for more information from the original poster label May 29, 2024
@sxyazi
Copy link
Owner

sxyazi commented May 29, 2024

Do you mean to move the errors from the task manager to the log file for async tasks, or to keep the errors in the task manager and also copy them to the log file?

The reason I didn't add them to the error log before is that async tasks are often concurrent, making it hard to track their order in the log. But in the task manager, we can inspect and view errors in the list for each task individually.

@sxyazi sxyazi mentioned this issue May 30, 2024
55 tasks
@sxyazi
Copy link
Owner

sxyazi commented May 30, 2024

And maybe the UI could be improved to show more info:
the tasklist could show if the task is running or failed ?

Added to the Feature Requests as Group tasks in Task Manager by "Running"/"Failed"

@sxyazi sxyazi closed this as completed May 30, 2024
@sxyazi
Copy link
Owner

sxyazi commented May 30, 2024

Added some error notifications for the mime plugin, hoping to make the transition to v0.3 smoother :)

Copy link

I'm going to lock this issue because it has been closed for 30 days. ⏳
This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants