finch icon indicating copy to clipboard operation
finch copied to clipboard

refactor: log format

Open sivchari opened this issue 2 years ago • 2 comments

Issue #, if available:

Description of changes:

I fixed log format. It's failed on purpose to confirm the logs.

DEBU[0000] Creating limactl command: ARGUMENTS: [ls -f {{.Status}} finch], LIMA_HOME: /user/workspace/finch/lima/data 
DEBU[0000] Status of virtual machine:                   
INFO[0000] dependency socket_vmnet file not found: open /user/workspace/finch/dependencies/lima-socket_vmnet/opt/finch/bin/socket_vmnet: no such file or directory 
INFO[0000] Requesting root access to finish network dependency configuration 
Password:
DEBU[0004] Creating limactl command: ARGUMENTS: [sudoers], LIMA_HOME: /user/workspace/finch/lima/data 
DEBU[0004] config file not found: %!w(*fs.PathError=&{open /user/workspace/finch/lima/data/_config/override.yaml 2}) 
INFO[0004] dependency socket_vmnet file not found: open /user/workspace/finch/dependencies/lima-socket_vmnet/opt/finch/bin/socket_vmnet: no such file or directory 
ERRO[0004] Dependency error: failed to install dependencies: [Failed to finish installing rootful dependencies which are needed for external network access within the guest OS. Boot will continue, but container exposed ports will not be accessible from macOS.: [error copying files to directory /opt/finch, err: exit status 1, stderr: cp: /user/workspace/finch/dependencies/lima-socket_vmnet/opt/finch: No such file or directory
 skipping installation of network configuration because pre-requisites are missing]] 
FATA[0004] failed to load the lima config file: open /user/workspace/finch/lima/data/_config/override.yaml: no such file or directory

logrus finally call (*Entry).Logf. The function uses fmt.Sprintf to format. So, %w cannot use to format.

Testing done:

  • [x] I've reviewed the guidance in CONTRIBUTING.md

License Acceptance

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

sivchari avatar Nov 24 '22 08:11 sivchari

Note that this duplicates my earlier PR: https://github.com/runfinch/finch/pull/39

kokes avatar Nov 24 '22 14:11 kokes

Changing the PR title from fix: to refactor: due to https://github.com/runfinch/finch/pull/48#issuecomment-1326492033.

davidhsingyuchen avatar Dec 05 '22 22:12 davidhsingyuchen