You've already forked mariadb-columnstore-engine
							
							
				mirror of
				https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
				synced 2025-10-31 18:30:33 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			71 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			71 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| /* Copyright (C) 2014 InfiniDB, Inc.
 | |
| 
 | |
|    This program is free software; you can redistribute it and/or
 | |
|    modify it under the terms of the GNU General Public License
 | |
|    as published by the Free Software Foundation; version 2 of
 | |
|    the License.
 | |
| 
 | |
|    This program is distributed in the hope that it will be useful,
 | |
|    but WITHOUT ANY WARRANTY; without even the implied warranty of
 | |
|    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | |
|    GNU General Public License for more details.
 | |
| 
 | |
|    You should have received a copy of the GNU General Public License
 | |
|    along with this program; if not, write to the Free Software
 | |
|    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 | |
|    MA 02110-1301, USA. */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <string>
 | |
| #include "IDBDataFile.h"
 | |
| #include "IDBFileSystem.h"
 | |
| #include "logger.h"
 | |
| 
 | |
| namespace idbdatafile
 | |
| {
 | |
| class IDBLogger
 | |
| {
 | |
|  public:
 | |
|   static void enable(bool enabled);
 | |
|   static bool isEnabled();
 | |
| 
 | |
|   static void logOpen(IDBDataFile::Types type, const char* fname, const char* mode, unsigned opts,
 | |
|                       IDBDataFile* ret);
 | |
|   static void logNoArg(const std::string& fname, const IDBDataFile* ptr, const char* op, int ret);
 | |
|   static void logRW(const char* op, const std::string& fname, const IDBDataFile* ptr, size_t offset,
 | |
|                     size_t count, size_t bytesRead);
 | |
|   static void logSeek(const std::string& fname, const IDBDataFile* ptr, off64_t offset, int whence, int ret);
 | |
|   static void logTruncate(const std::string& fname, const IDBDataFile* ptr, off64_t length, int ret);
 | |
|   static void logSize(const std::string& fname, const IDBDataFile* ptr, long long ret);
 | |
| 
 | |
|   static void logFSop(IDBFileSystem::Types type, const char* op, const char* pathname,
 | |
|                       const IDBFileSystem* ptr, long long ret);
 | |
|   static void logFSop2(IDBFileSystem::Types type, const char* op, const char* oldpath, const char* newpath,
 | |
|                        const IDBFileSystem* ptr, long long ret);
 | |
| 
 | |
|   static void syslog(const std::string& msg, logging::LOG_TYPE level);
 | |
| 
 | |
|  private:
 | |
|   static void writeLog(const std::string& logmsg);
 | |
| 
 | |
|   // prevent anyone from instantiating
 | |
|   IDBLogger();
 | |
| 
 | |
|   static std::string get_backtrace(int to_skip, int num_to_show);
 | |
| 
 | |
|   static bool s_enabled;
 | |
| };
 | |
| 
 | |
| inline void IDBLogger::enable(bool enabled)
 | |
| {
 | |
|   s_enabled = enabled;
 | |
| }
 | |
| 
 | |
| inline bool IDBLogger::isEnabled()
 | |
| {
 | |
|   return s_enabled;
 | |
| }
 | |
| 
 | |
| }  // namespace idbdatafile
 |