/
EvilBeaver
/
OneScript
Обзор
Документация
Войти
/
EvilBeaver
/
OneScript
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
src/ScriptEngine/SystemLogger.cs
51 строка
1 KB
EvilBeaver
fixes #1540 Предупреждение о неявных импортах
01 дек 2025, 12:27
01 дек 2025, 12:27
9ef7b18
Код
Авторство
О чём код?
/*---------------------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v.2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. ----------------------------------------------------------*/ using System; namespace ScriptEngine { public static class SystemLogger { static SystemLogger() { SetWriter(new NullWriter()); } public static void SetWriter(ISystemLogWriter writer) { if (writer == null) throw new ArgumentNullException(); _writer = writer; } public static void Reset() { _writer = new NullWriter(); } public static void Write(string text) { _writer.Write(text); } private class NullWriter : ISystemLogWriter { public void Write(string text) { } } private static ISystemLogWriter _writer; } public interface ISystemLogWriter { void Write(string text); } }