2 * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd All Rights Reserved
4 * Contact: Bumjin Im <bj.im@samsung.com>
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License
19 * @file audit-smack-log.h
20 * @author Marek Smolinski (m.smolinski@samsung.com)
22 * @brief AuditSmackLog loging SMACK access deny sequentially into files
25 #ifndef _AUDIT_SMACK_LOG_
26 #define _AUDIT_SMACK_LOG_
28 #include <dpl/log/abstract_log_provider.h>
36 namespace SecurityManager {
40 public AbstractLogProvider
44 virtual ~AuditSmackLog();
48 virtual void Debug(const char *message,
51 const char *function);
52 virtual void Info(const char *message,
55 const char *function);
56 virtual void Warning(const char *message,
59 const char *function);
60 virtual void Error(const char *message,
63 const char *function);
64 virtual void Pedantic(const char *message,
67 const char *function);
68 virtual void SecureDebug(const char *message,
71 const char *function);
72 virtual void SecureInfo(const char *message,
75 const char *function);
76 virtual void SecureWarning(const char *message,
79 const char *function);
80 virtual void SecureError(const char *message,
83 const char *function);
85 virtual void SmackAudit(const char *message,
88 const char *function);
91 void HandleWrite(const char *message,
94 const char *function);
97 int RemoveOldestLogFile();
100 bool IsFileFull(std::ofstream &fs) const;
103 unsigned int m_filesCount;
104 unsigned int m_fileMaxBytesSize;
106 std::map<time_t, std::string> m_fileNameMap;
107 std::ofstream m_outputStream;
109 std::mutex m_writeMtx;
113 } // namespace SecurityManager
114 #endif // _AUDIT_SMACK_LOG_