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

[config]logfile to append #6566

Open
maplestory03 opened this issue Nov 30, 2024 · 3 comments
Open

[config]logfile to append #6566

maplestory03 opened this issue Nov 30, 2024 · 3 comments

Comments

@maplestory03
Copy link

mode
Mode in which the file is opened; use "w" to truncate or "a" to append (see the built-in open() function)
Default: "w"

    "output":
    {
    ……
        "mode": "a",
   ……
    }
     "logging":
     {
      "mode": "a"
     }

all don't work
where can I set the mode?

@mikf
Copy link
Owner

mikf commented Nov 30, 2024

In output.logfile:

"#": "write logging messages to a separate file",
"logfile": {
"path": "~/gallery-dl/log.txt",
"mode": "w",
"level": "debug"
},

@maplestory03
Copy link
Author

maplestory03 commented Nov 30, 2024

"format": "[{post_id}_{creator['screen_name']}_{post_num}_{num}][{name}][{levelname}] {message}"
{post_id} ,{creator['screen_name']} ……also can't use?
hope to know when warning and error happend what user or page is

@mikf
Copy link
Owner

mikf commented Dec 1, 2024

Logging messages have only a limited set of replacement fields:

https://gdl-org.github.io/docs/configuration.html#logging-configuration

In addition to the default LogRecord attributes, it is also possible to access the current extractor, job, path, and keywords objects and their attributes, for example "{extractor.url}", "{path.filename}", "{keywords.title}"

You might be able to access metadata values via keywords, e.g. {keywords.post_id}, but they might be None or empty or referring to the previous file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants