Skip to content

GordonZhang2024/log.cc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

log.cc

A simple logging library for C++

Usage

copy src/log.cc and src/log.h to your source directory.

example

#include "log.h"

int main()
{
	logger l("log.txt");
	l.log(ERROR, "error message");
	return 0;
}

Availible levels
  • TRACE
  • DEBUG
  • INFO
  • WARNING
  • ERROR
  • FATAL

The full example is in the example/ directory.

Setting the log level

You can use the set_log_level function. example: l.set_log_level(WARNING);

Disable

You can use the disable function. example: l.disable(); To enable the logger again, use the enable function.

Releases

No releases published

Packages

No packages published

Languages