Changeset cba45af in mainline for uspace/srv/logger/logger.h


Ignore:
Timestamp:
2012-08-16T21:01:55Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2bf781a
Parents:
e005f92
Message:

Rewrite logger (work in progress)

Major issues

  • no locking
  • no clean-up (at all)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/logger/logger.h

    re005f92 rcba45af  
    4242#include <bool.h>
    4343#include <fibril_synch.h>
     44#include <stdio.h>
    4445
    4546#define NAME "logger"
    46 #define MAX_NAMESPACE_LENGTH 256
     47#define MAX_SUBLOGS 64
    4748#define LOG_LEVEL_USE_DEFAULT (LVL_LIMIT + 1)
    4849
    49 typedef struct logging_namespace logging_namespace_t;
     50typedef struct {
     51        const char *name;
     52        log_level_t logged_level;
     53} logger_sublog_t;
    5054
    51 logging_namespace_t *namespace_create(const char *);
    52 const char *namespace_get_name(logging_namespace_t *);
    53 void namespace_destroy(logging_namespace_t *);
    54 logging_namespace_t *namespace_writer_attach(const char *);
    55 void namespace_writer_detach(logging_namespace_t *);
     55typedef struct {
     56        const char *name;
     57        FILE *logfile;
     58        log_level_t logged_level;
     59        size_t sublog_count;
     60        logger_sublog_t sublogs[MAX_SUBLOGS];
    5661
    57 int namespace_change_level(logging_namespace_t *, log_level_t);
     62        link_t link;
     63} logger_toplevel_log_t;
    5864
    59 bool namespace_has_reader(logging_namespace_t *, sysarg_t, log_level_t);
    60 void namespace_add_message(logging_namespace_t *, const char *, sysarg_t, log_level_t);
    6165
    62 int namespace_create_context(logging_namespace_t *, const char *);
    63 int namespace_change_context_level(logging_namespace_t *, const char *, log_level_t);
     66logger_toplevel_log_t *find_or_create_toplevel_log(const char *);
     67logger_toplevel_log_t *find_toplevel_log(sysarg_t);
     68bool shall_log_message(logger_toplevel_log_t *, sysarg_t, log_level_t);
     69int add_sub_log(logger_toplevel_log_t *, const char *, sysarg_t *);
    6470
    6571log_level_t get_default_logging_level(void);
Note: See TracChangeset for help on using the changeset viewer.