Unable to open file name

王林
Release: 2024-02-08 21:03:04
forward
1553 people have browsed it

Unable to open file name

Question content

I received the following error log:

2023/12/27 04:11:26 open : The system cannot find the file specified.
Copy after login

I have many function calls, for example:

    pth := "..."

    data, err := os.ReadFile(pth)
    if err != nil {
        log.Fatalf(err.Error())
    }
Copy after login

Easier Debugging

I want to modify the error logs so that they write the exact name of the file that cannot be opened. Is there an automated way to force the log to do this?


Correct answer


As @icza commented:

As for me:

The above is the detailed content of Unable to open file name. For more information, please follow other related articles on the PHP Chinese website!

source:stackoverflow.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!