Browse Source

Add "[carla]" prefix to printed messages directly by carla

Closes #1498

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.4.2
falkTX 3 years ago
parent
commit
63854e73da
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      source/utils/CarlaUtils.hpp

+ 7
- 3
source/utils/CarlaUtils.hpp View File

@@ -117,15 +117,16 @@ void carla_debug(const char* const fmt, ...) noexcept
if (output == stdout) if (output == stdout)
{ {
#ifdef CARLA_OS_MAC #ifdef CARLA_OS_MAC
std::fprintf(output, "\x1b[37;1m");
std::fprintf(output, "\x1b[37;1m[carla] ");
#else #else
std::fprintf(output, "\x1b[30;1m");
std::fprintf(output, "\x1b[30;1m[carla] ");
#endif #endif
std::vfprintf(output, fmt, args); std::vfprintf(output, fmt, args);
std::fprintf(output, "\x1b[0m\n"); std::fprintf(output, "\x1b[0m\n");
} }
else else
{ {
std::fprintf(output, "[carla] ");
std::vfprintf(output, fmt, args); std::vfprintf(output, fmt, args);
std::fprintf(output, "\n"); std::fprintf(output, "\n");
} }
@@ -147,6 +148,7 @@ void carla_stdout(const char* const fmt, ...) noexcept
try { try {
::va_list args; ::va_list args;
::va_start(args, fmt); ::va_start(args, fmt);
std::fprintf(output, "[carla] ");
std::vfprintf(output, fmt, args); std::vfprintf(output, fmt, args);
std::fprintf(output, "\n"); std::fprintf(output, "\n");
#ifndef DEBUG #ifndef DEBUG
@@ -168,6 +170,7 @@ void carla_stderr(const char* const fmt, ...) noexcept
try { try {
::va_list args; ::va_list args;
::va_start(args, fmt); ::va_start(args, fmt);
std::fprintf(output, "[carla] ");
std::vfprintf(output, fmt, args); std::vfprintf(output, fmt, args);
std::fprintf(output, "\n"); std::fprintf(output, "\n");
#ifndef DEBUG #ifndef DEBUG
@@ -192,12 +195,13 @@ void carla_stderr2(const char* const fmt, ...) noexcept


if (output == stderr) if (output == stderr)
{ {
std::fprintf(output, "\x1b[31m");
std::fprintf(output, "\x1b[31m[carla] ");
std::vfprintf(output, fmt, args); std::vfprintf(output, fmt, args);
std::fprintf(output, "\x1b[0m\n"); std::fprintf(output, "\x1b[0m\n");
} }
else else
{ {
std::fprintf(output, "[carla] ");
std::vfprintf(output, fmt, args); std::vfprintf(output, fmt, args);
std::fprintf(output, "\n"); std::fprintf(output, "\n");
} }


Loading…
Cancel
Save