plugin-support.c.in 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. Plugin Name
  3. Copyright (C) <Year> <Developer> <Email Address>
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License along
  13. with this program. If not, see <https://www.gnu.org/licenses/>
  14. */
  15. #include <plugin-support.h>
  16. const char *PLUGIN_NAME = "@CMAKE_PROJECT_NAME@";
  17. const char *PLUGIN_VERSION = "@CMAKE_PROJECT_VERSION@";
  18. void obs_log(int log_level, const char *format, ...)
  19. {
  20. size_t length = 4 + strlen(PLUGIN_NAME) + strlen(format);
  21. char *template = malloc(length + 1);
  22. snprintf(template, length, "[%s] %s", PLUGIN_NAME, format);
  23. va_list(args);
  24. va_start(args, format);
  25. blogva(log_level, template, args);
  26. va_end(args);
  27. free(template);
  28. }