feisty meow concerns codebase 2.140
program_wide_logger.cpp
Go to the documentation of this file.
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
18using namespace basis;
19using namespace loggers;
20
21namespace loggers {
22
23standard_log_base *program_wide_logger::c_the_wide_log = new console_logger();
24
25standard_log_base &program_wide_logger::get() { return *c_the_wide_log; }
26
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
static loggers::standard_log_base & get()
Provided by the startup code within each application for logging.
static loggers::standard_log_base * set(loggers::standard_log_base *new_log)
replaces the current program-wide logger with the "new_log".
A base class for a very usable logger with a filter_set and eol awareness.
#define NULL_POINTER
The value representing a pointer to nothing.
Definition definitions.h:32
The guards collection helps in testing preconditions and reporting errors.
Definition array.h:30
A logger that sends to the console screen using the standard output device.