New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Log class with the standard and widely used Logback Library #24

Closed
manoelcampos opened this Issue Aug 28, 2016 · 1 comment

Comments

Projects
None yet
1 participant
@manoelcampos
Owner

manoelcampos commented Aug 28, 2016

Replace the CloudSim Log class by the Logback as logging engine and SL4J as logging facade.

An example scenario where this feature can be used

Log messages will be printed with different colors depending on the message type, as depicted below.

log-messages-by-type

Using Logback, you can even customize the log by creating a logback.xml file inside the resource directory of your simulation's project. The default CloudSim Plus configuration is defined here.

It also enables filtering simulation logs by different categories (namely ERROR, WARN, INFO, DEBUG and TRACE), giving a more fine-grained control over log messages. This way, debug process will be easier. It will enable the developer to show just the type of messages relevant to his/her experiments.

The line of code below shows an example of how to enable a specific level of log messages. It can be called before instantiating the CloudSim object.

//Make sure to import org.cloudsimplus.util.Log;
Log.setLevel(ch.qos.logback.classic.Level.WARN);

A brief explanation of why you think this feature is useful

The developer will be able to select the kind of logs he/she want to show, using a standard, well-known library. He/she will have more options when exporting the log and could create its own categories of log messages.

References

@manoelcampos manoelcampos changed the title from Replace the Log class by the Log4J library to Replace the Log class by standard and widely used Library Nov 16, 2016

@manoelcampos manoelcampos changed the title from Replace the Log class by standard and widely used Library to Replace the Log class by standard and widely used Log Library Nov 16, 2016

@manoelcampos manoelcampos modified the milestone: CloudSim Plus 2.0 Dec 14, 2016

@manoelcampos manoelcampos changed the title from Replace the Log class by standard and widely used Log Library to Replace the Log class by a standard and widely used Log Library May 30, 2017

@manoelcampos manoelcampos self-assigned this Jun 27, 2018

@manoelcampos manoelcampos changed the title from Replace the Log class by a standard and widely used Log Library to Replace Log class by a standard and widely used Log Library Jun 28, 2018

@manoelcampos manoelcampos changed the title from Replace Log class by a standard and widely used Log Library to Replace Log class with the standard and widely used LogBack Library Jun 28, 2018

@manoelcampos manoelcampos changed the title from Replace Log class with the standard and widely used LogBack Library to Replace Log class with the standard and widely used Logback Library Jun 28, 2018

@manoelcampos manoelcampos added feature and removed in-progress labels Jun 28, 2018

@manoelcampos

This comment has been minimized.

Owner

manoelcampos commented Jun 28, 2018

Hello @AbderrahmanL,

The issue is closed and moves CloudSim Plus to 3.0 release. Despite simple, it changed a huge number of classes to provide a feature that will be extremely useful. Since you are working on your fork, as soon as you update it, easier it will be.

manoelcampos added a commit that referenced this issue Jun 28, 2018

Updates README after closing issue #24
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>

manoelcampos added a commit that referenced this issue Jun 28, 2018

Updates README after closing issue #24
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment