[pulseaudio-commits] r1427 - /trunk/src/pulsecore/log.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Wed Feb 14 01:26:49 PST 2007


Author: ossman
Date: Wed Feb 14 10:26:48 2007
New Revision: 1427

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=3D1427&root=3Dpulseaudio&vi=
ew=3Drev
Log:
Prefix log lines with a character indicating level.

Modified:
    trunk/src/pulsecore/log.c

Modified: trunk/src/pulsecore/log.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulsecore/log.c?rev=
=3D1427&root=3Dpulseaudio&r1=3D1426&r2=3D1427&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/src/pulsecore/log.c (original)
+++ trunk/src/pulsecore/log.c Wed Feb 14 10:26:48 2007
@@ -129,6 +129,7 @@
         switch (log_target) {
             case PA_LOG_STDERR: {
                 const char *prefix =3D "", *suffix =3D "";
+                const char *level_code =3D "";
                 char *local_t;
 =

 #ifndef OS_IS_WIN32
@@ -144,11 +145,33 @@
                 }
 #endif
 =

+                switch (level) {
+                    case PA_LOG_ERROR:
+                        level_code =3D "E";
+                        break;
+                    case PA_LOG_WARN:
+                        level_code =3D "W";
+                        break;
+                    case PA_LOG_NOTICE:
+                        level_code =3D "N";
+                        break;
+                    case PA_LOG_INFO:
+                        level_code =3D "I";
+                        break;
+                    case PA_LOG_DEBUG:
+                        level_code =3D "D";
+                        break;
+                    default:
+                        level_code =3D "?";
+                }
+
                 local_t =3D pa_utf8_to_locale(t);
-                if (!local_t)
-                    fprintf(stderr, "%s%s%s%s\n", location, prefix, t, suf=
fix);
-                else {
-                    fprintf(stderr, "%s%s%s%s\n", location, prefix, local_=
t, suffix);
+                if (!local_t) {
+                    fprintf(stderr, "%s: %s%s%s%s\n", level_code, location,
+                        prefix, t, suffix);
+                } else {
+                    fprintf(stderr, "%s: %s%s%s%s\n", level_code, location,
+                        prefix, local_t, suffix);
                     pa_xfree(local_t);
                 }
 =





More information about the pulseaudio-commits mailing list