Skip to content

Commit

Permalink
Added a logging sample.
Browse files Browse the repository at this point in the history
  • Loading branch information
muriloadriano committed Mar 31, 2013
1 parent 50fc8df commit 1036c2f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
11 changes: 11 additions & 0 deletions samples/json.clv
@@ -1,3 +1,14 @@
/**
* Clever programming language
* Copyright (c) Clever Team
*
* This file is distributed under the MIT license. See LICENSE for details.
*/

/**
* Example of use of to_json function.
*/

import std.*;

class Person {
Expand Down
21 changes: 21 additions & 0 deletions samples/logging.clv
@@ -0,0 +1,21 @@
/**
* Clever programming language
* Copyright (c) Clever Team
*
* This file is distributed under the MIT license. See LICENSE for details.
*/

/**
* Example of std.logging module.
*/

import std.*;
import modules.std.logging.logger.*;

var logger = getLogger('test');
logger.warning('Sample warning!');

// Disabling waring reports
logger.setEnabledLevels(ALL ^ WARNING);
logger.warning('Do not print this warning!');
logger.info('This is an info!');

0 comments on commit 1036c2f

Please sign in to comment.