Object
8 years ago
Subject
8 years ago
API.php
8 years ago
Cache.php
8 years ago
Compatibility.php
8 years ago
Config.php
8 years ago
ConfigPress.php
8 years ago
Console.php
8 years ago
Exporter.php
8 years ago
Importer.php
8 years ago
Log.php
8 years ago
Login.php
8 years ago
Media.php
8 years ago
Object.php
8 years ago
Request.php
8 years ago
Server.php
8 years ago
Subject.php
8 years ago
Log.php
47 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * ====================================================================== |
| 5 | * LICENSE: This file is subject to the terms and conditions defined in * |
| 6 | * file 'license.txt', which is part of this source code package. * |
| 7 | * ====================================================================== |
| 8 | */ |
| 9 | |
| 10 | /** |
| 11 | * AAM Core Log |
| 12 | * |
| 13 | * @package AAM |
| 14 | * @author Vasyl Martyniuk <vasyl@vasyltech.com> |
| 15 | */ |
| 16 | class AAM_Core_Log { |
| 17 | |
| 18 | /** |
| 19 | * Add new warning |
| 20 | * |
| 21 | * @param string $message |
| 22 | * |
| 23 | * @return void |
| 24 | * |
| 25 | * @access public |
| 26 | * @static |
| 27 | */ |
| 28 | public static function add($message) { |
| 29 | $basedir = WP_CONTENT_DIR . '/aam/logs'; |
| 30 | $ok = file_exists($basedir); |
| 31 | |
| 32 | if (!$ok) { |
| 33 | $ok = @mkdir($basedir, fileperms( ABSPATH ) & 0777 | 0755, true); |
| 34 | } |
| 35 | |
| 36 | if ($ok) { |
| 37 | $ok = error_log( |
| 38 | '[' . date('Y-m-d H:i:s') . '] ' . $message . "\n", |
| 39 | 3, |
| 40 | $basedir . '/aam.log' |
| 41 | ); |
| 42 | } |
| 43 | |
| 44 | return $ok; |
| 45 | } |
| 46 | |
| 47 | } |