Skip to content

Commit

Permalink
* Add a MAXDEBUG log level.
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Maggard committed Mar 8, 2012
1 parent ce50494 commit 02bc88b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
1 change: 1 addition & 0 deletions log.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ char *level_name[] = {
"warn", // E_WARN
"info", // E_INFO
"debug", // E_DEBUG
"maxdebug", // E_MAXDEBUG
0
};

Expand Down
13 changes: 7 additions & 6 deletions log.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
#ifndef __ERR_H__
#define __ERR_H__

#define E_OFF 0
#define E_FATAL 1
#define E_ERROR 2
#define E_WARN 3
#define E_INFO 4
#define E_DEBUG 5
#define E_OFF 0
#define E_FATAL 1
#define E_ERROR 2
#define E_WARN 3
#define E_INFO 4
#define E_DEBUG 5
#define E_MAXDEBUG 6

enum _log_facility
{
Expand Down
26 changes: 13 additions & 13 deletions tagutils/tagutils-ogg.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,50 +106,50 @@ _ogg_vorbis_process(ogg_stream_processor *stream, ogg_page *page,
{
if(ogg_page_granulepos(page) != 0 || ogg_stream_packetpeek(&stream->os, NULL) == 1)
DPRINTF(E_WARN, L_SCANNER, "No header in vorbis stream %d\n", stream->num);
DPRINTF(E_DEBUG, L_SCANNER, "Vorbis headers parsed for stream %d, "
DPRINTF(E_MAXDEBUG, L_SCANNER, "Vorbis headers parsed for stream %d, "
"information follows...\n", stream->num);
DPRINTF(E_DEBUG, L_SCANNER, "Channels: %d\n", inf->vi.channels);
DPRINTF(E_DEBUG, L_SCANNER, "Rate: %ld\n\n", inf->vi.rate);
DPRINTF(E_MAXDEBUG, L_SCANNER, "Channels: %d\n", inf->vi.channels);
DPRINTF(E_MAXDEBUG, L_SCANNER, "Rate: %ld\n\n", inf->vi.rate);

psong->samplerate = inf->vi.rate;
psong->channels = inf->vi.channels;

if(inf->vi.bitrate_nominal > 0)
{
DPRINTF(E_DEBUG, L_SCANNER, "Nominal bitrate: %f kb/s\n",
DPRINTF(E_MAXDEBUG, L_SCANNER, "Nominal bitrate: %f kb/s\n",
(double)inf->vi.bitrate_nominal / 1000.0);
psong->bitrate = inf->vi.bitrate_nominal / 1000;
}
else
{
int upper_rate, lower_rate;

DPRINTF(E_DEBUG, L_SCANNER, "Nominal bitrate not set\n");
DPRINTF(E_MAXDEBUG, L_SCANNER, "Nominal bitrate not set\n");

//
upper_rate = 0;
lower_rate = 0;

if(inf->vi.bitrate_upper > 0)
{
DPRINTF(E_DEBUG, L_SCANNER, "Upper bitrate: %f kb/s\n",
DPRINTF(E_MAXDEBUG, L_SCANNER, "Upper bitrate: %f kb/s\n",
(double)inf->vi.bitrate_upper / 1000.0);
upper_rate = inf->vi.bitrate_upper;
}
else
{
DPRINTF(E_DEBUG, L_SCANNER, "Upper bitrate not set\n");
DPRINTF(E_MAXDEBUG, L_SCANNER, "Upper bitrate not set\n");
}

if(inf->vi.bitrate_lower > 0)
{
DPRINTF(E_DEBUG, L_SCANNER, "Lower bitrate: %f kb/s\n",
DPRINTF(E_MAXDEBUG, L_SCANNER, "Lower bitrate: %f kb/s\n",
(double)inf->vi.bitrate_lower / 1000.0);
lower_rate = inf->vi.bitrate_lower;;
}
else
{
DPRINTF(E_DEBUG, L_SCANNER, "Lower bitrate not set\n");
DPRINTF(E_MAXDEBUG, L_SCANNER, "Lower bitrate not set\n");
}

if(upper_rate && lower_rate)
Expand All @@ -163,7 +163,7 @@ _ogg_vorbis_process(ogg_stream_processor *stream, ogg_page *page,
}

if(inf->vc.comments > 0)
DPRINTF(E_DEBUG, L_SCANNER,
DPRINTF(E_MAXDEBUG, L_SCANNER,
"User comments section follows...\n");

for(i = 0; i < inf->vc.comments; i++)
Expand Down Expand Up @@ -437,7 +437,7 @@ _get_oggfileinfo(char *filename, struct song_metadata *psong)
return -1;
}

DPRINTF(E_INFO, L_SCANNER, "Processing file \"%s\"...\n\n", filename);
DPRINTF(E_MAXDEBUG, L_SCANNER, "Processing file \"%s\"...\n\n", filename);

ogg_sync_init(&sync);

Expand Down Expand Up @@ -482,7 +482,7 @@ _get_oggfileinfo(char *filename, struct song_metadata *psong)

if(p->isnew)
{
DPRINTF(E_DEBUG, L_SCANNER, "New logical stream (#%d, serial: %08x): type %s\n",
DPRINTF(E_MAXDEBUG, L_SCANNER, "New logical stream (#%d, serial: %08x): type %s\n",
p->num, p->serial, p->type);
if(!p->start)
DPRINTF(E_WARN, L_SCANNER,
Expand Down Expand Up @@ -514,7 +514,7 @@ _get_oggfileinfo(char *filename, struct song_metadata *psong)
{
if(p->process_end)
p->process_end(p, psong);
DPRINTF(E_DEBUG, L_SCANNER, "Logical stream %d ended\n", p->num);
DPRINTF(E_MAXDEBUG, L_SCANNER, "Logical stream %d ended\n", p->num);
p->isillegal = 1;
p->constraint_violated = CONSTRAINT_PAGE_AFTER_EOS;
}
Expand Down

0 comments on commit 02bc88b

Please sign in to comment.