From 79e048a7a607521c3ce9e723dbfafea6f5febf15 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Tue, 4 Feb 2025 23:42:44 +0530 Subject: [PATCH] PR fix: Remove additional log lines --- src/internal/function.go | 6 +----- src/internal/get_data.go | 3 --- src/internal/model.go | 8 -------- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/src/internal/function.go b/src/internal/function.go index 635a00e..6d08d40 100644 --- a/src/internal/function.go +++ b/src/internal/function.go @@ -44,7 +44,6 @@ func returnFocusType(focusPanel focusPanelType) filePanelFocusType { // Need to rename folder to directory. func returnDirectoryElement(location string, displayDotFile bool, sortOptions sortOptionsModelData) (directoryElement []element) { - slog.Debug("returnFolderElement() called.") dirEntries, err := os.ReadDir(location) if err != nil { outPutLog("Return folder element function error", err) @@ -66,6 +65,7 @@ func returnDirectoryElement(location string, displayDotFile bool, sortOptions so var order func(i, j int) bool reversed := sortOptions.reversed + // Todo : These strings should not be hardcoded here, but defined as constants switch sortOptions.options[sortOptions.selected] { case "Name": order = func(i, j int) bool { @@ -124,7 +124,6 @@ func returnDirectoryElement(location string, displayDotFile bool, sortOptions so } sort.Slice(dirEntries, order) - for _, item := range dirEntries { directoryElement = append(directoryElement, element{ name: item.Name(), @@ -132,9 +131,6 @@ func returnDirectoryElement(location string, displayDotFile bool, sortOptions so location: filepath.Join(location, item.Name()), }) } - - slog.Debug("returnFolderElement() returning.", "directoryElement", directoryElement) - return directoryElement } diff --git a/src/internal/get_data.go b/src/internal/get_data.go index 5baff5d..e667fe1 100644 --- a/src/internal/get_data.go +++ b/src/internal/get_data.go @@ -14,7 +14,6 @@ import ( // Return all sidebar directories func getDirectories() []directory { - slog.Debug("getDirectories() called") directories := []directory{} directories = append(directories, getWellKnownDirectories()...) @@ -28,7 +27,6 @@ func getDirectories() []directory { location: "Disks+-*/=?", }) directories = append(directories, getExternalMediaFolders()...) - slog.Debug("getDirectories() returning", "directories", directories) return directories } @@ -68,7 +66,6 @@ func getPinnedDirectories() []directory { jsonData, err := os.ReadFile(variable.PinnedFile) if err != nil { outPutLog("Read superfile data error", err) - // Should exit here return directories } diff --git a/src/internal/model.go b/src/internal/model.go index b120a42..c4842fe 100644 --- a/src/internal/model.go +++ b/src/internal/model.go @@ -51,8 +51,6 @@ func (m model) Init() tea.Cmd { // Update function for bubble tea to provide internal communication to the // application func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { - slog.Debug("model.Update() called.", "current width", m.fullWidth, - "current height", m.fullHeight) var cmd tea.Cmd switch msg := msg.(type) { @@ -72,15 +70,11 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { // check if there already have listening message if !ListeningMessage { - slog.Debug("ListeningMessage is false in model Update()") cmd = tea.Batch(cmd, listenForChannelMessage(channel)) } m.getFilePanelItems() - slog.Debug("model.Update() returning.", "current width", m.fullWidth, - "current height", m.fullHeight) - return m, tea.Batch(cmd) } @@ -254,7 +248,6 @@ func (m *model) handleKeyInput(msg tea.KeyMsg, cmd tea.Cmd) tea.Cmd { // Update the file panel state. Change name of renamed files, filter out files // in search, update typingb bar, etc func (m *model) updateFilePanelsState(msg tea.Msg, cmd *tea.Cmd) { - slog.Debug("updateFilePanelsState() called") focusPanel := &m.fileModel.filePanels[m.filePanelFocusIndex] if m.firstTextInput { m.firstTextInput = false @@ -275,7 +268,6 @@ func (m *model) updateFilePanelsState(msg tea.Msg, cmd *tea.Cmd) { // Update the sidebar state. Change name of the renaming pinned directory. func (m *model) updateSidebarState(msg tea.Msg, cmd *tea.Cmd) { - slog.Debug("updateSidebarState() is called") sidebar := &m.sidebarModel if sidebar.renaming { sidebar.rename, *cmd = sidebar.rename.Update(msg)