Lognote - My toy project

In a project, the code work is limited


When I say, "I think it will work if I change it like this," I get, "If it doesn't cause any problems, leave it as is."

Since code can cause unexpected issues if changed, I can't change it as I please.

Especially for work...


That's why I thought of the Toy project I read in the book.

Codes that I can modify as I please without affecting my work

When I was thinking about what to make, I thought it would be good if it could help my work, so I started making a log viewer.

Since it started in 2020, I worked on it for quite a long time.

I worked on it when I had time, so it didn't progress quickly, but I think it was made usefully.


When I first made it, there were a lot of errors, so I was embarrassed..

When I looked at the log, I added the parts I thought were necessary and fixed the errors.

Since the development work was done as I wanted and didn't require anyone's permission, it was fun.

Even now, when my head feels like it's stopped, I think about how to change it and apply the changed code.


When you want to freely change the code but can't, and want to relieve that frustration, try thinking about a Toy project, which can be helpful in its own way.

Lognote - Show only specific package logs

If you want to show logs only for a specific package, you can use uid.
Since uids associated with package names do not overlap unless you use sharedId, you can distinguish package logs by uid.

1. Install the app
   The uid value is set when the app is installed, so install the app first.

2. Get uid value
   After installing the package, check the uid value with the following command.
   Windows - adb.exe shell cmd package dump PACKAGE_NAME
             Check the userId or packageUid value in the output.
             ex) adb.exe shell cmd package dump com.example.myapplication > package.txt
                    
Linux, mac - adb shell cmd package dump PACKAGE_NAME | grep packageUid 3. Apply the uid value confirmed to Lognote Temporary apply(test): Add "--uid=XXX" to the logcat command above in lognote. (Removed when Lognote is restarted)
     
Add settings: Add "--uid=XXX" to the logcat command. (keep when Lognote is restarted) Setting > Log cmd You can check the newly added command in the log command combo box.
     

4. Result - Only logs based on uid values

* The uid is maintained, so you only need to check the uid when installing it for the first time.

Lognote - Log viewer, Android logcat viewer for Windows, Linux, Mac

android logcat viewer for Windows, Linux, Mac





https://github.com/cdcsgit/lognote


Filtered log viewer
Android logcat viewer, kotlin + swing


Run
- Windows : start javaw -Dfile.encoding=utf8 -Xmx1024m -jar LogNote.jar
- Linux : java -Dfile.encoding=utf8 -Xmx2048m -jar LogNote.jar
- Mac : java -Dfile.encoding=utf8 -Xmx2048m -jar LogNote.jar


Tips

- Show only specific package logs


Changes

version 0.3.7
- Added view by column
- Added process name column
- Modified UI

version 0.3.6
- Bug fixes
- Added log file format setting function (setting file format with different log level information)
- Add log trigger (execute command or output dialog when specific log occurs during aging test)

version 0.3.5
- Bug fix (fix hang during process update)
- Color tags can be applied to regex filters
- Move logcat level setting location from menu bar to bottom status bar
- Added log view (full, filtered) save function

version 0.3.4
- Bug fixes
- Add a pop-up to determine whether to apply previously used filters when opening a recent file.
- Add update cycle setting menu for process information

version 0.3.3
- When the focus is moved by key input in logcat receiving mode, log process information is displayed in the tool tip
- Execution mode displayed on the title bar
- Save / load recent files (save bookmarks)
- Code refactoring
- Outputs a list of available colors when entering '#' in the log filter combo box

version 0.3.2
- Add "Check Update" menu
- When mode is logcat receiving, process info is shown as a tooltip
- Save recent files and filters(Save filters by file)
- Code refactoring
- bug fix

version 0.3.1
- Shortcut logic refactored
- Add color tag menu when adding filter
- bug fix

version 0.3.0
- Add icon to button
- Change the titlebar according to the log mode (Open, Adb, Cmd, Follow) shown in the log view
- bug fix

version 0.2.9
- Change default font: dialog -> dialoginput
- Change text color when regular expression parsing error occurs (notification)
- Move to the previous item when shift-enter is input in search
- bug fix

version 0.2.8
- Added logcat command change function
- Added search function
    Ctrl + F: Show search bar
    ESC: Hide search bar
    F3: Move to the previous item
    F4: Move to the next item
    Click on filter or full log view: set search target view

version 0.2.7
- Added color setting function for each filter item
- Add filter text append function when Ctrl + filter button is executed

version 0.2.6
- Combine UI and log color related settings
- Changed the UI for applying the built-in color palette
- Bug fixes

version 0.2.5
- Added the ability to change the font size of UI components
- Added built-in color palette function (light, dark)
- Filter / bold text FG / BG color settings
- Save file default prefix "LogNote"
- Filter / Apply bold color in case of overlapping bold text
- Improved stability??

version 0.2.4
- Set the config file location by referring to the environment variable "LOGNOTE_HOME"
- Apply FlatLaf (https://github.com/JFormDesigner/FlatLaf)

version 0.2.3
- Apply filter input combo box multi-line
- Fixed the problem that the log aspect ratio does not change below a certain size when adjusting the log aspect ratio
- Code cleanup

version 0.2.2
- Added connection retry logic when connection is lost due to device reboot, etc.
- Save immediately when setting changes (no need to close the window)

version 0.2.1
- Added multi-line bookmark function (simultaneous bookmarking after selecting multiple lines)
- Add color setting item

version 0.2.0
- Improved logcat read speed in adb
- Improved filter application speed
- Add color setting item

version 0.1.9
- Modify so that frequently used filters can be added to the table bar
- Add order change function to filter management dialog
- Add frequently used command management function

version 0.1.8
- Show a list of open files on the status bar tooltip
- Show Error popup when adb connection view fails
- Show include and exclude items in the filter tooltip

version 0.1.7
- Hide unused filter combo box
- Close dialog when ESC key is pressed

version 0.1.6
- Open multiple files at the same time
- added tooltip
- Windows drag & drop improvement
- Added a function to pause log deletion due to scrollback limit

version 0.1.5
- Added log color setting
- Improvement of cursor movement in the entire log view when moving the cursor in the filter log view
- Improved view behavior when deleting logs due to scrollback line limitation

version 0.1.4
- Applied immediately when changing the font in settings
- Save and import filters

version 0.1.1
- Add pop-up menu
- case sensitive

version 0.0.1
- Regular expression filter
- On/Off line log view

Values used by crontab

cron is a command provided in Linux to periodically schedule specific tasks.

Set up tasks through contab.

editor settings
When executing crontab -e, the select-editor command is called and the editor is set.

When you want to change the editor, run select-editor or change the value of SELECTED_EDITOR in ~/.selected_editor.

If the desired editor is not found when executing the select-editor command, change the SELECTED_EDITOR value.

When you run the crontab -e command, you can use the value in the following format.

m h dom mon dow command

field          allowed values
-----          --------------
minute         0–59
hour           0–23
day of month   1–31
month          1–12 (or names, see below)
day of week    0–7 (0 or 7 is Sun, or use names)

(Manual page crontab(5))

 

Example

The following lists an example of a user crontab file.    
    
# use /bin/bash to run commands, instead of the default /bin/sh    
SHELL=/bin/bash    
# mail any output to `paul', no matter whose crontab this is    
MAILTO=paul    
#    
# run five minutes after midnight, every day    
5 0 * * *       $HOME/bin/daily.job >> $HOME/tmp/out 2>&1    
# run at 2:15pm on the first of every month — output mailed to paul    
15 14 1 * *     $HOME/bin/monthly    
# run at 10 pm on weekdays, annoy Joe    
0 22 * * 1-5    mail -s "It's 10pm" joe%Joe,%%Where are your kids?%    
23 0-23/2 * * * echo "run 23 minutes after midn, 2am, 4am ..., everyday"    
5 4 * * sun     echo "run at 5 after 4 every Sunday"    
0 */4 1 * mon   echo "run every 4th hour on the 1st and on every Monday"    
0 0 */2 * sun   echo "run at midn on every Sunday that's an uneven date"    
# Run on every second Saturday of the month    
0 4 8-14 * *    test $(date +\%u) -eq 6 && echo "2nd Saturday"    
    
All the above examples run non-interactive programs.  If you wish to run a program that interacts with  the    
user's desktop you have to make sure the proper environment variable DISPLAY is set.    
    
# Execute a program and run a notification every day at 10:00 am    
0 10 * * *  $HOME/bin/program | DISPLAY=:0 notify-send "Program run" "$(cat)"

(Manual page crontab(5))

 

Reserved words can also be used

string         meaning
------         -------
@reboot        Run once, at startup.
@yearly        Run once a year, "0 0 1 1 *".
@annually      (same as @yearly)
@monthly       Run once a month, "0 0 1 * *".
@weekly        Run once a week, "0 0 * * 0".
@daily         Run once a day, "0 0 * * *".
@midnight      (same as @daily)
@hourly        Run once an hour, "0 * * * *".

(Manual page crontab(5))

 

Lognote - My toy project

In a project, the code work is limited When I say, "I think it will work if I change it like this," I get, "If it doesn't...