Cross Reference: Log.h
xref: /gem5/ext/dsent/libutil/Log.h
  • Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /gem5/ext/dsent/libutil/
Log.h revision 10447
1955SN/A#ifndef __LOG_H__
2955SN/A#define __LOG_H__
31762SN/A
4955SN/A#include <cstdio>
5955SN/A#include <iostream>
6955SN/A#include <fstream>
7955SN/A
8955SN/A#include "String.h"
9955SN/A
10955SN/A#ifndef LIBUTIL_IS_LOG
11955SN/A#define LIBUTIL_IS_LOG false
12955SN/A#endif
13955SN/A
14955SN/Anamespace LibUtil
15955SN/A{
16955SN/A    using std::cerr;
17955SN/A
18955SN/A    class Log
19955SN/A    {
20955SN/A        public:
21955SN/A            static void allocate(const String& log_file_name_);
22955SN/A            static void release();
23955SN/A
24955SN/A            static void print(const String& str_);
25955SN/A            static void print(std::ostream& stream_, const String& str_);
26955SN/A            static void printLine(const String& str_);
27955SN/A            static void printLine(std::ostream& stream_, const String& str_);
282665Ssaidi@eecs.umich.edu
294762Snate@binkert.org        protected:
30955SN/A            static Log* msSingleton;
315522Snate@binkert.org            static const bool msIsLog;
326143Snate@binkert.org
334762Snate@binkert.org        protected:
345522Snate@binkert.org            Log(const String& log_file_name_);
35955SN/A            ~Log();
365522Snate@binkert.org
37955SN/A        protected:
385522Snate@binkert.org            std::ofstream ofs;
394202Sbinkertn@umich.edu    };
405742Snate@binkert.org}
41955SN/A
424381Sbinkertn@umich.edu#endif // __LOG_H__
434381Sbinkertn@umich.edu
448334Snate@binkert.org

Indexes created Thu Sep 26 06:36:22 EDT 2019