Getting logs

Ensure that the G_MESSAGES_DEBUG and GNOME_PHOTOS_DEBUG environment variables are defined before launching the application. They will make Photos show some extra debug messages. The variables can be set to the special value all, in which case it will show all possible debug messages coming from the application and the libraries underneath it.

$ G_MESSAGES_DEBUG=all GNOME_PHOTOS_DEBUG=all gnome-photos

It is possible to only log a subset of the messages. Set G_MESSAGES_DEBUG to gnome-photos to limit them to only those coming from Photos itself. You can further limit them by sub-systems within the application using the GNOME_PHOTOS_DEBUG variable. The possible values are listed below.

Value

Description

Since

help

Shows all the supported debug values.

3.16

all

Special value that includes everything else below.

3.16

application

The stages in the lifetime of the GApplication.

3.26

dlna

Communication with DLNA Digital Media Renderers

3.16

gegl

Babl format of the GeglBuffer when an image is decoded for viewing; the state of the GEGL graph when editing; and a spattering of performance figures of operations performed on the UI thread that could potentially freeze the UI if not sufficiently fast.

3.16

network

Network activity when thumbnailing and viewing non-local images; and caching metadata about remote content through the online miners.

3.16

thumbnailer

Communication between the application and its custom out-of-process thumbnailer; and stages of each thumbnailing operation.

3.24

tracker

SPARQL queries used to communicate with Tracker and the time taken to handle them.

3.16

For example, to only log the Photos' GApplication start-up and shutdown sequences, and the SPARQL statements used to communicate with Tracker:

$ G_MESSAGES_DEBUG=gnome-photos GNOME_PHOTOS_DEBUG=application:tracker gnome-photos

Run-time failures are always logged as WARNINGs and unexpected programming errors are logged as CRITICALs. They are shown regardless of the values of the debug variables above. Check your operating system's logging facilities (eg., journalctl) to find them.

Checking the environment

Local content

By default, local content is pulled from XDG_DESKTOP_DIR, XDG_DOWNLOAD_DIR and XDG_PICTURES_DIR. To check where they are pointing to:

$ cat .config/user-dirs.dirs 
...
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"

You can add custom locations using the Search panel in Settings.

Photos uses Tracker as its metadata cache and it should be configured to index and monitor these locations. Tracker uses GSettings for its configuration, and refers to the XDG presets as &DESKTOP, &DOWNLOAD and &PICTURES. On a functional system, without any custom locations, you might see:

$ gsettings get org.freedesktop.Tracker.Miner.Files index-recursive-directories
['&DESKTOP', '&DOCUMENTS', '&DOWNLOAD', '&MUSIC', '&PICTURES', '&VIDEOS']

Note that only directories listed under index-recursive-directories are monitored recursively. Those under index-single-directories are not.

Online or remote content

Online or remote content is pulled from online accounts with the “photos” feature. You can look at the GNOME Online Accounts documentation on how to debug this integration.

Metadata cache

Photos uses Tracker to harvest and cache metadata about the content coming from the above sources. It uses SPARQL as the query language, and the tracker command can be used to control and interface with the Tracker services. Tracker's manual for application developers covers SPARQL extensively.

Missing content

Photos shows content from the XDG_DESKTOP_DIR, XDG_DOWNLOAD_DIR and XDG_PICTURES_DIR directories, custom locations added through the Search panel, and your online accounts. It queries Tracker for relevant content in these locations. It tries to limit itself to photographs and screenshots, and skips MIME types that it doesn't have support for (eg., GIFs).

So if you are missing some content, check if your environment is properly set up (see above). Then, check the entries in Tracker's database.

For example, to list all known photographs and their MIME types:

$ tracker sparql -q \
>  "SELECT nie:url(?urn) nie:mimeType(?urn) \
>   WHERE {?urn a nmm:Photo}"

Wrong metadata

For local content, check the metadata of the file extracted by Tracker:

$ tracker info ~/Pictures/balconies.jpg 
Querying information for entity:'/home/rishi/Pictures/balconies.jpg'
  'urn:uuid:335f04ef-be16-c7b8-6f3e-f040d5b5b0e0'
Results:
  'http://purl.org/dc/elements/1.1/date' = '2015-04-01T13:58:59Z'
  'http://purl.org/dc/elements/1.1/date' = '2017-06-22T16:27:05Z'
  'http://purl.org/dc/elements/1.1/source' = 'http://www.tracker-project.org/ontologies/tracker#extractor-data-source'
  'http://purl.org/dc/elements/1.1/source' = 'urn:nepomuk:datasource:9291a450-1d49-11de-8c30-0800200c9a66'
  'tracker:added' = '2017-06-22T16:31:33Z'
  'tracker:modified' = '2152'
  'rdf:type' = 'http://www.w3.org/2000/01/rdf-schema#Resource'
  'rdf:type' = 'http://www.semanticdesktop.org/ontologies/2007/01/19/nie#DataObject'
  'rdf:type' = 'http://www.semanticdesktop.org/ontologies/2007/01/19/nie#InformationElement'
  'rdf:type' = 'http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject'
  'rdf:type' = 'http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Media'
  'rdf:type' = 'http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Visual'
  'rdf:type' = 'http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Image'
  'rdf:type' = 'http://www.tracker-project.org/temp/nmm#Photo'
  'nie:byteSize' = '317077'
  'nie:dataSource' = 'http://www.tracker-project.org/ontologies/tracker#extractor-data-source'
  'nie:dataSource' = 'urn:nepomuk:datasource:9291a450-1d49-11de-8c30-0800200c9a66'
  'nie:isPartOf' = 'urn:uuid:570e411e-5c4c-2c99-ca46-26532dff56f3'
  'nie:url' = 'file:///home/rishi/Pictures/balconies.jpg'
  'nfo:belongsToContainer' = 'urn:uuid:570e411e-5c4c-2c99-ca46-26532dff56f3'
  'tracker:available' = 'true'
  'nie:isStoredAs' = 'urn:uuid:335f04ef-be16-c7b8-6f3e-f040d5b5b0e0'
  'nie:mimeType' = 'image/jpeg'
  'nfo:fileLastAccessed' = '2017-06-22T16:27:05Z'
  'nfo:fileLastModified' = '2015-04-01T13:58:59Z'
  'nfo:fileName' = 'balconies.jpg'
  'nfo:fileSize' = '317077'
  'nmm:dlnaMime' = 'image/jpeg'
  'nmm:dlnaProfile' = 'JPEG_LRG'
  'nfo:height' = '1024'
  'nfo:width' = '683'
  'nfo:horizontalResolution' = '72'
  'nfo:verticalResolution' = '72'

Apps/Photos/Debugging (last edited 2017-10-20 13:51:22 by DebarshiRay)