In the specific case of open-source software, a lot of projects have information on the usage of their official logos. For example, MariaDB has a logo page with some official downloads and graphical information. In our own work, we use Apache Spark and we have found their logo guidelines helpful, as well as the more general guidelines from the Apache Software Foundation.
The Apache Software Foundation lays out the general legal case behind using logos quite well, actually [ref]:
Anyone can use ASF trademarks if that use of the trademark is nominative. The "nominative use" (or "nominative fair use") defense to trademark infringement is a legal doctrine that authorizes everyone (even commercial companies) to use another person's trademark as long as three requirements are met:
- The product or service in question must be one not readily identifiable without use of the trademark; (for example, it is not easy to identify Apache Hadoop® software without using the trademark "Hadoop")
- Only so much of the mark or marks may be used as is reasonably necessary to identify the product or service; and
- The organization using the mark must do nothing that would, in conjunction with the mark, suggest sponsorship or endorsement by the trademark holder.
The trademark nominative fair use defense is intended to encourage people to refer to trademarked goods and services by using the trademark itself. This trademark defense has nothing to do with copyright fair use and should not be confused with those rules.
The latter point to me, is key. For example, we make sure we're not giving the impression that we are "sponsored by Apache Spark," we just use and build upon the tools that they provide.