Skip to content

khubaibumer/loggerlib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodeFactor Codacy Badge Softacheck Documentation

LoggerLib

Functions

logger_t* create_logger(const char *path)

Creates and returns pointer to the newly created by the logger at specified path

logger_t* get_logger(void)

Returns pointer to the already created logger

bool close_logger(void)

Close the logging library

bool set_max_file_size(size_t max)

Automatically changes the file when max size is reached

Macros

  • TRACE(fmt, ...)
  • DEBUG(fmt, ...)
  • INFO(fmt, ...)
  • WARN(fmt, ...)
  • ERROR(fmt, ...)

Sample Code

create_logger("/va/logs/LoggerTest");
set_max_file_size(KB(3));
get_logger()->trace(__func__, __LINE__, "%s\n", "ftw");
TRACE("%s\n", "Wow!!!");
close_logger();