Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Log.php « CRT « AWS « src « aws-crt-php « aws - github.com/nextcloud/3rdparty.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: de042f3436d905ca72d418a387eb91335325309b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0.
 */
namespace AWS\CRT;
use AWS\CRT\CRT;

final class Log {
    const NONE = 0;
    const FATAL = 1;
    const ERROR = 2;
    const WARN = 3;
    const INFO = 4;
    const DEBUG = 5;
    const TRACE = 6;

    public static function toStdout() {
        CRT::log_to_stdout();
    }

    public static function toStderr() {
        CRT::log_to_stderr();
    }

    public static function toFile($filename) {
        CRT::log_to_file($filename);
    }

    public static function toStream($stream) {
        assert(get_resource_type($stream) == "stream");
        CRT::log_to_stream($stream);
    }

    public static function stop() {
        CRT::log_stop();
    }

    public static function setLogLevel($level) {
        assert($level >= self::NONE && $level <= self::TRACE);
        CRT::log_set_level($level);
    }

    public static function log($level, $message) {
        CRT::log_message($level, $message);
    }
}