libassa  3.5.1
StdOutLogger.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 //------------------------------------------------------------------------------
3 // $Id: StdOutLogger.h,v 1.3 2003/07/25 02:51:47 vlg Exp $
4 //------------------------------------------------------------------------------
5 // StdOutLogger.h
6 //------------------------------------------------------------------------------
7 // Copyright (c) 2001 by Vladislav Grinchenko
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU Library General Public
11 // License as published by the Free Software Foundation; either
12 // version 2 of the License, or (at your option) any later version.
13 //------------------------------------------------------------------------------
14 // Created: 10/31/2001
15 //------------------------------------------------------------------------------
16 #ifndef STDOUT_LOGGER_H
17 #define STDOUT_LOGGER_H
18 
19 #include <fstream>
20 #include <string>
21 #include <iostream>
22 
23 #include "assa/Logger_Impl.h"
24 
25 namespace ASSA {
26 
32 class StdOutLogger : public Logger_Impl
33 {
34 public:
35  StdOutLogger () { /*empty*/ }
36 
37  virtual int log_open (u_long groups_);
38  virtual int log_close (void);
39 
40  virtual int log_msg (Group g_,
41  size_t indent_level_,
42  const string& func_name_,
43  size_t expected_sz_,
44  const char* fmt_, va_list);
45 
46  virtual int log_func (Group g_,
47  size_t indent_level_,
48  const string& func_name_,
49  marker_t type_);
50  virtual void log_resync ();
51 
52 private:
55 };
56 
57 /*******************************************************************************
58  Inline member functions
59 *******************************************************************************/
60 inline int
62 log_open (u_long groups_)
63 {
64  m_groups = groups_;
65  return 0;
66 }
67 
68 inline int
70 log_close (void)
71 {
72  return 0;
73 }
74 
75 inline void
77 log_resync ()
78 {
79  std::cout << std::flush;
80 }
81 
82 
83 } // end namespace ASSA
84 
85 #endif /* STDERR_LOGGER_H */
unsigned long u_long
Definition: Logger_Impl.h:41
u_long m_groups
Enabled groups.
Definition: Logger_Impl.h:239
StdOutLogger(const StdOutLogger &)
virtual int log_open(u_long groups_)
Open StdErr Logger.
Definition: StdOutLogger.h:62
virtual int log_msg(Group g_, size_t indent_level_, const string &func_name_, size_t expected_sz_, const char *fmt_, va_list)
virtual int log_func(Group g_, size_t indent_level_, const string &func_name_, marker_t type_)
virtual int log_close(void)
Definition: StdOutLogger.h:70
StdOutLogger & operator=(const StdOutLogger &)
no cloning
virtual void log_resync()
Definition: StdOutLogger.h:77
Definition: Acceptor.h:40
Socket & flush(Socket &os_)
flush manipulator.
Definition: Socket.h:587
marker_t
Definition: LogMask.h:67
Group
Definition: LogMask.h:25