Skip to content

Commit 58a8ccf

Browse files
committed
Remove useless logging
The errors are already reported upstream via returned `err` value
1 parent 06a3564 commit 58a8ccf

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

arduino/libraries/librariesmanager/install.go

-36
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929
"github.com/arduino/arduino-cli/arduino/utils"
3030
paths "github.com/arduino/go-paths-helper"
3131
"github.com/codeclysm/extract/v3"
32-
"github.com/sirupsen/logrus"
3332
"gopkg.in/src-d/go-git.v4"
3433
"gopkg.in/src-d/go-git.v4/plumbing"
3534
)
@@ -175,19 +174,9 @@ func (lm *LibrariesManager) InstallZipLib(ctx context.Context, archivePath strin
175174
if !overwrite {
176175
return fmt.Errorf(tr("library %s already installed"), libraryName)
177176
}
178-
logrus.
179-
WithField("library name", libraryName).
180-
WithField("install path", installPath).
181-
Trace("Deleting library")
182177
installPath.RemoveAll()
183178
}
184179

185-
logrus.
186-
WithField("library name", libraryName).
187-
WithField("install path", installPath).
188-
WithField("zip file", archivePath).
189-
Trace("Installing library")
190-
191180
// Copy extracted library in the destination directory
192181
if err := extractionPath.CopyDirTo(installPath); err != nil {
193182
return fmt.Errorf(tr("moving extracted archive to destination dir: %s"), err)
@@ -205,9 +194,6 @@ func (lm *LibrariesManager) InstallGitLib(gitURL string, overwrite bool) error {
205194

206195
libraryName, ref, err := parseGitURL(gitURL)
207196
if err != nil {
208-
logrus.
209-
WithError(err).
210-
Warn("Parsing git URL")
211197
return err
212198
}
213199

@@ -217,22 +203,12 @@ func (lm *LibrariesManager) InstallGitLib(gitURL string, overwrite bool) error {
217203
if !overwrite {
218204
return fmt.Errorf(tr("library %s already installed"), libraryName)
219205
}
220-
logrus.
221-
WithField("library name", libraryName).
222-
WithField("install path", installPath).
223-
Trace("Deleting library")
224206
installPath.RemoveAll()
225207
}
226208
if installPath.Exist() {
227209
return fmt.Errorf(tr("could not create directory %s: a file with the same name exists!", installPath))
228210
}
229211

230-
logrus.
231-
WithField("library name", libraryName).
232-
WithField("install path", installPath).
233-
WithField("git url", gitURL).
234-
Trace("Installing library")
235-
236212
depth := 1
237213
if ref != "" {
238214
depth = 0
@@ -243,27 +219,15 @@ func (lm *LibrariesManager) InstallGitLib(gitURL string, overwrite bool) error {
243219
Progress: os.Stdout,
244220
})
245221
if err != nil {
246-
logrus.
247-
WithError(err).
248-
Warn("Cloning git repository")
249222
return err
250223
}
251224

252225
if ref != "" {
253226
if h, err := repo.ResolveRevision(ref); err != nil {
254-
logrus.
255-
WithError(err).
256-
Warnf("Resolving revision %s", ref)
257227
return err
258228
} else if w, err := repo.Worktree(); err != nil {
259-
logrus.
260-
WithError(err).
261-
Warn("Finding worktree")
262229
return err
263230
} else if err := w.Checkout(&git.CheckoutOptions{Hash: plumbing.NewHash(h.String())}); err != nil {
264-
logrus.
265-
WithError(err).
266-
Warnf("Checking out %s", h)
267231
return err
268232
}
269233
}

0 commit comments

Comments
 (0)