Coder Social home page Coder Social logo

logger's Introduction

logger

c logger library
it use the libcfg to get logger configuration.

Install

autoreconf -is
./configure
make
make install

Logger cfg key

logger.<name>.formata format string used to render record (see below)
logger.<name>.levelthe level of the logger (will only log record that have a superior level) {debug=0, info, warn, error, fatal, off}
logger.<name>.str_levelarray of string representation of level (used by %L)
logger.<name>.outreconize stdout, stderr and file:<path to logfile>

you can put . in name to order logger in cfg.

Reconized format in logger_t

these format are mostly compliant to strftime

%ADay name
%aAbrevied day name
%BMonth name
%b,%hAbrevied month name
%CCentury number on 2 digit
%cprefered datetime representation for this local
%Dlike %m/%d/%y
%dDay of month on 2 digit 0 padded
%elike %d but space padded
%Flike %Y-%m-%d
%Hhour ussing 24-hour clock 0 padded
%klike %H but space padded
%Ihour ussing 12-hour clock 0 padded
%llike %I but space padded
%jday in the year on 3 digit 0 padded
%MMinute 0 padded
%mMonth number 0 padded
%Ppm/am
%pPM/AM
%Rlike %H:%M
%rlike %I:%M:%S %p
%Ssecond 0 padded
%sseconds since Epoch
%Tlike %H:%M:%S
%ttab char
%Uweek number, starting with the first Sunday
%uday of week 1 to 7, 1=monday
%VISO 8601 week number
%GISO 8601 year (four digits)
%gISO 8601 year (two digits)
%vlike %e-%b-%Y
%Wlike %U but starting with the first Monday
%wday of week 0 to 6, 0=sunday
%Xprefered time representation for this local
%xprefered date representation for this local
%Yyear on 4 digit
%yyear no 2 digit
%ztimezone offset [+-]hhmm
%+like %a, %d %b %Y %H:%M:%S %z
%_output as printf with fmt, arg passed to _l
%Llogger level as string (from logger_t.str_level or {DBG, INF, WRN, ERR, FTL})
%nlogger name
%%% char

logger's People

Contributors

unknow0 avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.