Add debug logging to diagnose iOS stat date issue
iOS helper: log raw stat keys+values for first file to stderr. IosConnector: already logs stderr at WARN level. logback.xml: print DEBUG+ for photophetch package to console so stat output is visible when running ./gradlew run.
This commit is contained in:
13
src/main/resources/logback.xml
Normal file
13
src/main/resources/logback.xml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<configuration>
|
||||||
|
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{HH:mm:ss} [%-5level] %logger{20} - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<root level="WARN">
|
||||||
|
<appender-ref ref="CONSOLE" />
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<logger name="com.bolenpad.photophetch" level="DEBUG" />
|
||||||
|
</configuration>
|
||||||
@@ -69,6 +69,7 @@ async def cmd_list_photos():
|
|||||||
return
|
return
|
||||||
|
|
||||||
photos = []
|
photos = []
|
||||||
|
debug_logged = False # log raw stat for first file to help debug date issues
|
||||||
|
|
||||||
for folder in sorted(dcim_entries):
|
for folder in sorted(dcim_entries):
|
||||||
folder_path = f'/DCIM/{folder}'
|
folder_path = f'/DCIM/{folder}'
|
||||||
@@ -89,6 +90,10 @@ async def cmd_list_photos():
|
|||||||
date_iso = None
|
date_iso = None
|
||||||
try:
|
try:
|
||||||
info = await afc.stat(device_path)
|
info = await afc.stat(device_path)
|
||||||
|
if not debug_logged:
|
||||||
|
print(f'DEBUG stat keys: {list(info.keys())}', file=sys.stderr)
|
||||||
|
print(f'DEBUG stat values: {dict(info)}', file=sys.stderr)
|
||||||
|
debug_logged = True
|
||||||
size_bytes = int(info.get('st_size', 0))
|
size_bytes = int(info.get('st_size', 0))
|
||||||
mtime_raw = int(info.get('st_mtime', 0))
|
mtime_raw = int(info.get('st_mtime', 0))
|
||||||
# Determine if nanoseconds (>1e15) or seconds (>1e9)
|
# Determine if nanoseconds (>1e15) or seconds (>1e9)
|
||||||
|
|||||||
Reference in New Issue
Block a user