Merge branch 'main' of feistymeow.org:feisty_meow
[feisty_meow.git] / loggers / program_wide_logger.cpp
1 /*****************************************************************************\
2 *                                                                             *
3 *  Name   : program_wide_logger                                               *
4 *  Author : Chris Koeritz                                                     *
5 *                                                                             *
6 *******************************************************************************
7 * Copyright (c) 1994-$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 \*****************************************************************************/
14
15 #include "console_logger.h"
16 #include "program_wide_logger.h"
17
18 using namespace basis;
19 using namespace loggers;
20
21 namespace loggers {
22
23 standard_log_base *program_wide_logger::c_the_wide_log = new console_logger();
24
25 standard_log_base &program_wide_logger::get() { return *c_the_wide_log; }
26
27 standard_log_base *program_wide_logger::set(standard_log_base *new_log)
28 {
29   if (!new_log) return NULL_POINTER;  // can't fool me that easily.
30   standard_log_base *old_log = c_the_wide_log;
31   c_the_wide_log = new_log;
32   return old_log;
33 }
34
35 } //namespace.
36