Skip to content

fix: only logging when level permits it on Windows#569

Open
Piloalucard wants to merge 2 commits intoLinearTapeFileSystem:v2.4.8-windows-supportfrom
Piloalucard:fix/windows-logging-system
Open

fix: only logging when level permits it on Windows#569
Piloalucard wants to merge 2 commits intoLinearTapeFileSystem:v2.4.8-windows-supportfrom
Piloalucard:fix/windows-logging-system

Conversation

@Piloalucard
Copy link
Member

@Piloalucard Piloalucard commented Feb 6, 2026

Summary of changes

This pull request includes following changes or fixes.

Description

On Windows platform, logs of LTFS were not properly set up, every message is logged causing a performance issue when using LTFS with logs enabled. To fix this, a conditional was added to log only messages permitted by the log level set.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have confirmed my fix is effective or that my feature works

Copy link
Member

@vandelvan vandelvan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!

@Piloalucard Piloalucard requested a review from XV02 February 19, 2026 20:13
Copy link

@XV02 XV02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GTG!

@Piloalucard
Copy link
Member Author

Test

  1. Before fix (Debug messages printed even the log level is INFO, write performance affected)
PS C:\Program Files\IBM\LTFS> .\ltfs.exe -o changer_devname=0.0.20.1 L
LTFS61259I Sync type is "time", Sync time is 300 sec
LTFS61509I Set trace level in library (LTFS_INFO)
LTFS61206I LTFS starting. Drive:L, (Dec  9 2025 12:41:16) log level 2
LTFS17085I Plugin: Loading "scsilib" tape backend.
LTFS17085I Plugin: Loading "unified" iosched backend.
LTFS17085I Plugin: Loading "scsilib" changer backend.
LTFS17085I Plugin: Loading "memory" crepos backend.
LTFS11593I LTFS starts with a ILAN license version 2.4.8.2.
LTFS62611I Opening a device through scsilib driver (2ed5e5c0h).
LTFS62553D scsilib: scsiExecCDB(12h):.
LTFS62554D scsilib: scsiExecCDB(12h): rc=0 SysErr=0 SCSIStatus=00h sense=00h/0000h:32.
LTFS62553D scsilib: scsiExecCDB(12h):.
LTFS62554D scsilib: scsiExecCDB(12h): rc=0 SysErr=0 SCSIStatus=00h sense=00h/0000h:32.
LTFS62612D scsi0:0.20.1 is opened.
LTFS62613I Changer serial is 55L3A78014R3LL01.
  1. After fix (No debug messages because of level, no write performance issues)
PS C:\Program Files\ibm\LTFS> .\ltfs.exe -o changer_devname=5.0.0.1 L
LTFS61259I Sync type is "time", Sync time is 300 sec
LTFS61509I Set trace level in library (LTFS_INFO)
LTFS61206I LTFS starting. Drive:L, (Feb  6 2026 14:53:36) log level 2
LTFS17085I Plugin: Loading "scsilib" tape backend.
LTFS17085I Plugin: Loading "unified" iosched backend.
LTFS17085I Plugin: Loading "scsilib" changer backend.
LTFS17085I Plugin: Loading "memory" crepos backend.
LTFS11593I LTFS starts with a ILAN license version 2.4.8.
LTFS62611I Opening a device through scsilib driver (67e37370h).
LTFS62613I Changer serial is 55L3A78014R3LL02.
LTFS62160I Drive serial is 117193D065.
LTFS17160I Maximum device block size is 524288.
LTFS61509I Set trace level in library (LTFS_INFO)
LTFS11545I Rebuilding the cartridge inventory.
LTFS11627I Getting Inventory - 55L3A78014R3LL02.
LTFS11629I Aqcuireing MoveLock - 55L3A78014R3LL02.
LTFS11630I Aqcuired Move Lock (3) - 55L3A78014R3LL02.
LTFS11628I Got Inventory - 55L3A78014R3LL02.
LTFS11637I Reset the cartridge link against the drive 117193D065.
LTFS11571I State of tape 'FC0541L8' in slot 0x1 is changed from 'INIT' to 'NOT_MOUNTED_YET'.
LTFS11635I Link the drive 117193D065 to the cartridge FC0541L8.
LTFS11571I State of tape 'CLN156L1' in slot 0x3ea is changed from 'INIT' to 'NON_SUPPORTED_TAPE'.
LTFS11720I Built the cartridge inventory (0).
LTFS11774I Starting volume cache cleaning.
LTFS11775I Volume cache cleaning is finished
LTFS10005E Null argument (priv) to dcache_get_workdir.
LTFS11776I Starting volume cache load.
LTFS11777I Loaded required volume caches.
LTFS14708I LTFS admin server version 2 is starting on port 7600.
LTFS61280I Symbolic link type is (posix)
LTFS61237I Read-only directory mode is Windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants