1 /*****************************************************************************\
3 * Name : console_logger *
4 * Author : Chris Koeritz *
6 *******************************************************************************
7 * Copyright (c) 2000-$now By Author. This program is free software; you can *
8 * redistribute it and/or modify it under the terms of the GNU General Public *
9 * License as published by the Free Software Foundation; either version 2 of *
10 * the License or (at your option) any later version. This is online at: *
11 * http://www.fsf.org/copyleft/gpl.html *
12 * Please send any updates to: fred@gruntose.com *
13 \*****************************************************************************/
15 #include "console_logger.h"
16 #include "logging_filters.h"
20 using namespace basis;
24 console_logger::console_logger(stream_choices target) : c_target(target)
27 console_logger::~console_logger() {}
29 outcome console_logger::log(const base_string &info, int filter)
32 if (filter) {} //temp ignored
34 FILE *log_to = stdout;
35 if (c_target == TO_STDERR) log_to = stderr;
37 //hmmm: temp simplified form during bootup of new hoople.
38 fprintf(log_to, "%s\n", (char *)info.observe());
41 hmmm: need filter set support!
44 // format the output with %s to ensure we get all characters, rather
45 // than having some get interpreted if we used info as the format spec.
46 // fprintf(log_to, "%s", (char *)info.s());
47 // send the EOL char if the style is appropriate for that.
48 // if (eol() != NO_ENDING) fprintf(log_to, "%s", get_ending().s());
51 // write immediately to avoid lost output on crash.
55 hmmm: need filter set support!