Skip to content

syedaunn/C-Logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C-Logger

Simple file logger in C for debugging large C programs

usage: -Add header file to your c code i.e. #include "logger.h"

call the following function to write log to file.

filename can be given by macro: FILE line number can be given by macro: LINE

//void log_print(int debug_level,int rank,char* filename, int line, char *fmt,...);  //signature
e.g: log_print(DEBUG,0,__FILE__,__LINE__,"I have an error code %d",code);

Debug levels can be one of the following: INFO, DEBUG, ERROR, WARNING

Rank states the file number you want to write on a specific host. useful when debugging multi-thread code or working with mpi processes.

About

Simple file logger in C for debugging large C programs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages