2 * Copyright (c) 2014-2015 Sylvain Peyrefitte
4 * This file is part of node-rdpjs.
6 * node-rdpjs is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
29var Logger = require('bunyan');
33if (process.env.enable_log_file === 'true') {
36 type: 'rotating-file',
39 path: `node-rdpjs${process.pid}.log`,
40 level: process.env.log_level
47 stream: process.stderr,
48 level: process.env.log_level
52var logger = Logger.createLogger({
58function log(level, message) {
59 if (Levels[level] < module.exports.level) return;
60 console.log("[node-rdpjs] " + level + ":\t" + message);
67 level: Levels.INFO, // Levels.INFO,
69 debug: function (message) {
70 //console.log(message);
71 //logger.debug(message);
73 info: function (message) {
74 //console.log(message);
75 //logger.info(message);
77 warn: function (message) {
78 //console.log(message);
79 //logger.warn(message);
81 error: function (message) {
82 //console.log(message);
83 //logger.error(message);