Skip to content

shawn246/hola_logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

hola_logger

A simple log funciton implementation

  • Thread safe.
  • Use only << to logging
  • Support for limiting the size of sigle log file

Usage

#include "hola_logger.h"

using namespace hola;

int main()
{
    /// for console print
    LogOne<std::ostream>(std::cout) << "hola " << "logger";
    LogOne<std::ostream>(std::cout, LOG_FORCE) << "hola " << "logger";
    
    LogOne<std::ostream>::setLogLevel(LOG_TRACE);
    LogOne<std::ostream>::enableMilliSecond(true);
    LogOne<std::ostream>(std::cout, LOG_TRACE) << "hola " << "logger";
    
    /// for simple log file
    SimpleLogger slogger("hola1.log");
    slogger.enableMilliSecond(true);
    slogger.setLogLevel(LOG_DEBUG);
    LogOne<SimpleLogger>(slogger) << "hola " << "logger";
    LogOne<SimpleLogger>(slogger, LOG_DEBUG) << "hola " << "logger";
    
    /// for hola log file
    HolaLogger logger("hola2.log");
    logger.setLogMaxKb(512);

#define LOGI LogOne<HolaLogger>(logger, LOG_INFO)
    LOGI << "hola " << "logger";
}

About

A simple log implementation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages