Mlog, ready to emit on sourceforge.net

Source: Internet
Author: User
Tags emit

I spent a lot of time writing more English and finally submitted the mlog for the new project. As for whether the reject will be used, it is not my current consideration.

I am afraid this English is very bad. I don't know whether the sourceforge.net staff can understand it. "Sweat" first!

Mlog will be an open-source project based on Apache Software Licence 2.0.

 

Descriptions:

Mlog is a logging implementation, which is configuration based, portable, extendable, and simple to uses. it supports "logging-levels", "logging-Catalogs" and "multiple output-targets ". mlog is developments by liigo using C ++ programing language.

Mlog uses an optional config file, that just like Java's *. properties file or Windows '*. INI file. while mlog initializtion, it will searches and loads the config file, which maybe named "mlog-setting.txt" or "mlog-setting", in the current path. if not found, mlog will uses the default settings. in a common purpose, you do not even needs a config file.

Mlog supports "logging-levels": trace, debug, info, warning, error, fatal, print. every logging message has its own logging-level. by editting the config file, one or more or all logging-levels can be selected to output to the "logging-targets ".

Mlog supports "logging-Catalogs", which is identified by a string. by editting the config file, users can determines which logging-Catalogs (one or more, or none) can be output. the default logging-catalog is used by default.

Mlog support "output-targets", which is the targets where the logging messages will be outputed. at present, "console" and "file" is implemented, however, much more output-targets such as "email" or "Database" can be easily extended.

Mlog provides a sententious API. there is only one public class "mlog" with a few methods such as: trace (const char * szformat ,...), debug (const char * szformat ,...), info (const char * szformat ,...), warning (const char * szformat ,...), error (const char * szformat ,...), fatal (const char * szformat ,...), and print (const char * szformat ,...), all these methods are "printf ()" like, which is very familiar to C/C ++ developers.

 

Uasages:

First, # include "mlog. H", and then,

Mlog * log = mlog: getlog ();
Log-> trace ("a trace message ");
Log-> debug ("a debug message, % d, % s, % F", 123, "liigo", 3.14159 );
Log-> warning ("a Waring message ");
Log-> error ("an error message ");
Log-> fatal ("a fatal error message ");
Log-> Print ("print a message ");

Or:

Mlog-> trace ("a trace message ");
Mlog-> debug ("a debug message, % d, % s, % F", 123, "liigo.com", 3.14159 );
Mlog-> warning ("a Waring message ");
Mlog-> error ("an error message ");
Mlog-> fatal ("a fatal error message ");
Mlog-> Print ("print a message ");

Where, the "mlog" is a C ++ macro (# define mlog: getlog (), which equals to mlog: getlog ().

which logging messages are outputed, and where the messages are outputed is depends upon the settings of the config file. by default, the messages which logging-level is greater than or equals to "warning" will be outputed to the console window.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.