Turnstone Operating System
Loading...
Searching...
No Matches
logging.h File Reference

logging headers More...

#include <types.h>
#include <buffer.h>
#include <stdbufs.h>

Macros

#define ___LOGGING_H   0
 
#define LOG_LEVEL   LOG_INFO
 
#define LOG_LEVEL_KERNEL   LOG_INFO
 
#define LOG_LEVEL_MEMORY   LOG_INFO
 
#define LOG_LEVEL_SIMPLEHEAP   LOG_INFO
 
#define LOG_LEVEL_PAGING   LOG_INFO
 
#define LOG_LEVEL_FRAMEALLOCATOR   LOG_INFO
 
#define LOG_LEVEL_ACPI   LOG_INFO
 
#define LOG_LEVEL_ACPIAML   LOG_INFO
 
#define LOG_LEVEL_VIDEO   LOG_INFO
 
#define LOG_LEVEL_LINKER   LOG_INFO
 
#define LOG_LEVEL_TASKING   LOG_INFO
 
#define LOG_LEVEL_EFI   LOG_INFO
 
#define LOG_LEVEL_PCI   LOG_INFO
 
#define LOG_LEVEL_APIC   LOG_INFO
 
#define LOG_LEVEL_IOAPIC   LOG_INFO
 
#define LOG_LEVEL_TIMER   LOG_INFO
 
#define LOG_LEVEL_AHCI   LOG_INFO
 
#define LOG_LEVEL_NETWORK   LOG_INFO
 
#define LOG_LEVEL_VIRTIO   LOG_INFO
 
#define LOG_LEVEL_VIRTIONET   LOG_INFO
 
#define LOG_LEVEL_E1000   LOG_INFO
 
#define LOG_LEVEL_FAT   LOG_INFO
 
#define LOG_LEVEL_NVME   LOG_INFO
 
#define LOG_LEVEL_TOSDB   LOG_INFO
 
#define LOG_LEVEL_HEAP_HASH   LOG_INFO
 
#define LOG_LEVEL_VIRTIOGPU   LOG_INFO
 
#define LOG_LEVEL_HPET   LOG_INFO
 
#define LOG_LEVEL_VMWARESVGA   LOG_INFO
 
#define LOG_LEVEL_USB   LOG_INFO
 
#define LOG_LEVEL_COMPRESSION   LOG_INFO
 
#define LOG_LEVEL_COMPILER   LOG_INFO
 
#define LOG_LEVEL_COMPILER_ASSEMBLER   LOG_INFO
 
#define LOG_LEVEL_COMPILER_PASCAL   LOG_INFO
 
#define LOG_LEVEL_HYPERVISOR   LOG_INFO
 
#define LOG_LOCATION   1
 
#define LOG_NEED_LOG(M, L)   logging_need_logging(M, L)
 
#define LOGBLOCK(M, L)   if(LOG_NEED_LOG(M, L))
 
#define PRINTLOG(M, L, msg, ...)   logging_printlog(M, L, __FILE__, __LINE__, msg, ## __VA_ARGS__)
 kernel logging macro More...
 
#define NOTIMPLEMENTEDLOG(M)   PRINTLOG(M, LOG_ERROR, "not implemented: %s", __FUNCTION__)
 

Typedefs

typedef enum logging_modules_t logging_modules_t
 type short hand for enum logging_modules_e
 
typedef enum logging_level_t logging_level_t
 type short hand for enum logging_level_e
 

Enumerations

enum  logging_modules_t {
  KERNEL , MEMORY , SIMPLEHEAP , PAGING ,
  FRAMEALLOCATOR , ACPI , ACPIAML , VIDEO ,
  LINKER , TASKING , EFI , PCI ,
  APIC , IOAPIC , TIMER , AHCI ,
  NETWORK , VIRTIO , VIRTIONET , E1000 ,
  FAT , NVME , TOSDB , HEAP_HASH ,
  VIRTIOGPU , HPET , VMWARESVGA , USB ,
  COMPRESSION , COMPILER , COMPILER_ASSEMBLER , COMPILER_PASCAL ,
  HYPERVISOR
}
 logging module enums
 
enum  logging_level_t {
  LOG_PANIC =0 , LOG_FATAL =1 , LOG_ERROR =2 , LOG_WARNING =3 ,
  LOG_INFO =4 , LOG_DEBUG =5 , LOG_VERBOSE =7 , LOG_TRACE =9
}
 loggging levels
 

Functions

boolean_t logging_need_logging (logging_modules_t module, logging_level_t level)
 
void logging_set_level (logging_modules_t module, logging_level_t level)
 
void logging_printlog (uint64_t module, uint64_t level, const char_t *file_name, uint64_t line_no, const char_t *format,...)
 kernel logging function More...
 

Detailed Description

logging headers

This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.

Macro Definition Documentation

◆ ___LOGGING_H

#define ___LOGGING_H   0

prevent duplicate header error macro

◆ LOG_LEVEL

#define LOG_LEVEL   LOG_INFO

default log level for all modules

◆ LOG_LEVEL_ACPI

#define LOG_LEVEL_ACPI   LOG_INFO

default log level for acpi module

◆ LOG_LEVEL_ACPIAML

#define LOG_LEVEL_ACPIAML   LOG_INFO

default log level for acpi aml module

◆ LOG_LEVEL_AHCI

#define LOG_LEVEL_AHCI   LOG_INFO

default log level for ahci module

◆ LOG_LEVEL_APIC

#define LOG_LEVEL_APIC   LOG_INFO

default log level for apic module

◆ LOG_LEVEL_COMPILER

#define LOG_LEVEL_COMPILER   LOG_INFO

default log level for compiler module

◆ LOG_LEVEL_COMPILER_ASSEMBLER

#define LOG_LEVEL_COMPILER_ASSEMBLER   LOG_INFO

default log level for compiler assembler module

◆ LOG_LEVEL_COMPILER_PASCAL

#define LOG_LEVEL_COMPILER_PASCAL   LOG_INFO

default log level for compiler pascal module

◆ LOG_LEVEL_COMPRESSION

#define LOG_LEVEL_COMPRESSION   LOG_INFO

default log level for compression module

◆ LOG_LEVEL_E1000

#define LOG_LEVEL_E1000   LOG_INFO

default log level for e1000 module

◆ LOG_LEVEL_EFI

#define LOG_LEVEL_EFI   LOG_INFO

default log level for efi module

◆ LOG_LEVEL_FAT

#define LOG_LEVEL_FAT   LOG_INFO

default log level for fat module

◆ LOG_LEVEL_FRAMEALLOCATOR

#define LOG_LEVEL_FRAMEALLOCATOR   LOG_INFO

default log level for frame allocator module

◆ LOG_LEVEL_HEAP_HASH

#define LOG_LEVEL_HEAP_HASH   LOG_INFO

default log level for heap hash module

◆ LOG_LEVEL_HPET

#define LOG_LEVEL_HPET   LOG_INFO

default log level for hpet module

◆ LOG_LEVEL_HYPERVISOR

#define LOG_LEVEL_HYPERVISOR   LOG_INFO

default log level for hypervisor module

◆ LOG_LEVEL_IOAPIC

#define LOG_LEVEL_IOAPIC   LOG_INFO

default log level for ioapic module

◆ LOG_LEVEL_KERNEL

#define LOG_LEVEL_KERNEL   LOG_INFO

default log level for kernel module

◆ LOG_LEVEL_LINKER

#define LOG_LEVEL_LINKER   LOG_INFO

default log level for linker module

◆ LOG_LEVEL_MEMORY

#define LOG_LEVEL_MEMORY   LOG_INFO

default log level for memory module

◆ LOG_LEVEL_NETWORK

#define LOG_LEVEL_NETWORK   LOG_INFO

default log level for network module

◆ LOG_LEVEL_NVME

#define LOG_LEVEL_NVME   LOG_INFO

default log level for nvme module

◆ LOG_LEVEL_PAGING

#define LOG_LEVEL_PAGING   LOG_INFO

default log level for paging module

◆ LOG_LEVEL_PCI

#define LOG_LEVEL_PCI   LOG_INFO

default log level for pci module

◆ LOG_LEVEL_SIMPLEHEAP

#define LOG_LEVEL_SIMPLEHEAP   LOG_INFO

default log level for simple heap module

◆ LOG_LEVEL_TASKING

#define LOG_LEVEL_TASKING   LOG_INFO

default log level for tasking module

◆ LOG_LEVEL_TIMER

#define LOG_LEVEL_TIMER   LOG_INFO

default log level for timer module

◆ LOG_LEVEL_TOSDB

#define LOG_LEVEL_TOSDB   LOG_INFO

default log level for nvme module

◆ LOG_LEVEL_USB

#define LOG_LEVEL_USB   LOG_INFO

default log level for usb module

◆ LOG_LEVEL_VIDEO

#define LOG_LEVEL_VIDEO   LOG_INFO

default log level for video module

◆ LOG_LEVEL_VIRTIO

#define LOG_LEVEL_VIRTIO   LOG_INFO

default log level for virtio module

◆ LOG_LEVEL_VIRTIOGPU

#define LOG_LEVEL_VIRTIOGPU   LOG_INFO

default log level for vmware svga module

◆ LOG_LEVEL_VIRTIONET

#define LOG_LEVEL_VIRTIONET   LOG_INFO

default log level for virtio net module

◆ LOG_LEVEL_VMWARESVGA

#define LOG_LEVEL_VMWARESVGA   LOG_INFO

default log level for vmware svga module

◆ LOG_LOCATION

#define LOG_LOCATION   1

file and line no will be logged?

◆ LOG_NEED_LOG

#define LOG_NEED_LOG (   M,
 
)    logging_need_logging(M, L)

checks for need logging for log message

◆ LOGBLOCK

#define LOGBLOCK (   M,
 
)    if(LOG_NEED_LOG(M, L))

logs fellowing block

◆ PRINTLOG

#define PRINTLOG (   M,
  L,
  msg,
  ... 
)    logging_printlog(M, L, __FILE__, __LINE__, msg, ## __VA_ARGS__)

kernel logging macro

Parameters
[in]Mmodule name
See also
logging_modules_e
Parameters
[in]Llog level
See also
logging_level_e
Parameters
[in]msglog message, also if it contains after this there should be a variable arg list
[in]...arguments for format in msg

Function Documentation

◆ logging_printlog()

void logging_printlog ( uint64_t  module,
uint64_t  level,
const char_t file_name,
uint64_t  line_no,
const char_t format,
  ... 
)

kernel logging function

Parameters
[in]modulemodule name
See also
logging_modules_e
Parameters
[in]levellog level
See also
logging_level_e
Parameters
[in]line_noline number
[in]file_namefile name
[in]formatformat string
[in]...arguments for format in msg