summaryrefslogtreecommitdiff
path: root/frontends/atari
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2017-09-07 15:30:08 +0100
committerVincent Sanders <vince@kyllikki.org>2017-09-07 15:30:08 +0100
commitb9bdc279f228c6e70d05c85361fe7d018beba444 (patch)
tree644d6f0ba58b3c977f01ccb73a4143be24ec1309 /frontends/atari
parentb346790cf67d5bda40ed06c035f02d0af414361a (diff)
downloadnetsurf-b9bdc279f228c6e70d05c85361fe7d018beba444.tar.gz
netsurf-b9bdc279f228c6e70d05c85361fe7d018beba444.tar.bz2
Update scheduler logging to use catagory
Diffstat (limited to 'frontends/atari')
-rw-r--r--frontends/atari/schedule.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/frontends/atari/schedule.c b/frontends/atari/schedule.c
index a8d06e499..9a7836b1f 100644
--- a/frontends/atari/schedule.c
+++ b/frontends/atari/schedule.c
@@ -23,15 +23,10 @@
#include "utils/sys_time.h"
#include "utils/errors.h"
+#include "utils/log.h"
#include "atari/schedule.h"
-#ifdef DEBUG_SCHEDULER
-#include "utils/log.h"
-#else
-#define LOG(x...)
-#endif
-
#define MS_NOW() ((clock() * 1000) / CLOCKS_PER_SEC)
/* linked list of scheduled callbacks */
@@ -71,7 +66,7 @@ static nserror schedule_remove(void (*callback)(void *p), void *p)
return NSERROR_OK;
}
- NSLOG(netsurf, INFO, "removing %p, %p", callback, p);
+ NSLOG(schedule, DEBUG, "removing %p, %p", callback, p);
cur_nscb = schedule_list;
prev_nscb = NULL;
@@ -80,7 +75,7 @@ static nserror schedule_remove(void (*callback)(void *p), void *p)
if ((cur_nscb->callback == callback) &&
(cur_nscb->p == p)) {
/* item to remove */
- NSLOG(netsurf, INFO,
+ NSLOG(schedule, DEBUG,
"callback entry %p removing %p(%p)", cur_nscb,
cur_nscb->callback, cur_nscb->p);
@@ -120,7 +115,7 @@ nserror atari_schedule(int ival, void (*callback)(void *p), void *p)
nscb->timeout = MS_NOW() + ival;
- NSLOG(netsurf, INFO, "adding callback %p for %p(%p) at %d ms", nscb,
+ NSLOG(schedule, DEBUG, "adding callback %p for %p(%p) at %d ms", nscb,
callback, p, nscb->timeout);
nscb->callback = callback;
@@ -167,7 +162,7 @@ int schedule_run(void)
prev_nscb->next = unlnk_nscb->next;
}
- NSLOG(netsurf, INFO,
+ NSLOG(schedule, DEBUG,
"callback entry %p running %p(%p)", unlnk_nscb,
unlnk_nscb->callback, unlnk_nscb->p);
@@ -178,7 +173,7 @@ int schedule_run(void)
/* need to deal with callback modifying the list. */
if (schedule_list == NULL) {
- NSLOG(netsurf, INFO, "schedule_list == NULL");
+ NSLOG(schedule, DEBUG, "schedule_list == NULL");
return -1; /* no more callbacks scheduled */
}
@@ -203,7 +198,7 @@ int schedule_run(void)
/* make rettime relative to now and convert to ms */
nexttime = nexttime - now;
- NSLOG(netsurf, INFO, "returning time to next event as %ldms",
+ NSLOG(schedule, DEBUG, "returning time to next event as %ldms",
nexttime);
/*return next event time in milliseconds (24days max wait) */
@@ -216,15 +211,15 @@ void list_schedule(void)
{
struct nscallback *cur_nscb;
- NSLOG(netsurf, INFO, "schedule list at ms clock %ld", MS_NOW());
+ NSLOG(schedule, DEBUG, "schedule list at ms clock %ld", MS_NOW());
cur_nscb = schedule_list;
while (cur_nscb != NULL) {
- NSLOG(netsurf, INFO, "Schedule %p at %ld", cur_nscb,
+ NSLOG(schedule, DEBUG, "Schedule %p at %ld", cur_nscb,
cur_nscb->timeout);
cur_nscb = cur_nscb->next;
}
- NSLOG(netsurf, INFO, "Maxmium callbacks scheduled: %d", max_scheduled);
+ NSLOG(schedule, DEBUG, "Maxmium callbacks scheduled: %d", max_scheduled);
}