Skip to content
GordonZhang2024Public

About

A light-weight and easy-to-use logging library for C++

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Latest commit

 

History

107 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Log.cc

A simple logging library for C++

GitHub License Static Badge

Usage

Log.cc is very easy to use.

To use log.cc for your own project, you only need to copy src/log.cc and src/log.h to your own source directory.

Example

#include "log.h"

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

Note

Available levels

  • TRACE
  • DEBUG
  • INFO
  • WARNING
  • ERROR
  • FATAL

The full example is in the example/ directory. You can find more useful functions from log.cc

The following examples use l as the default logger name.

Want to format the output?

You can use the log() function in this way, just like printf():

l.log(WARNING, "%d", 1);

Tip

More info

You can view the Wiki page for more info.

License

MIT License

About

A light-weight and easy-to-use logging library for C++

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages