1 /** 2 * Модуль HTML логера 3 * 4 * Copyright: (c) 2015-2017, Milofon Project. 5 * License: Subject to the terms of the BSD license, as written in the included LICENSE.txt file. 6 * Authors: Maksim Galanin 7 */ 8 module dango.system.logging.loggers.html; 9 10 private 11 { 12 import vibe.core.log; 13 import vibe.core.concurrency: lock; 14 15 import proped: Properties; 16 17 import dango.system.logging.core; 18 } 19 20 21 /** 22 * Фабрика создающая HTML логгер 23 */ 24 class HTMLLoggerFactory : LoggerFactory 25 { 26 shared(Logger) createLogger(Properties config) 27 { 28 string fileName = config.getOrElse("file", "trand.html"); 29 LogLevel level = matchLogLevel(config.getOrElse("level", "info")); 30 31 auto result = cast(shared)new HTMLLogger(fileName); 32 { 33 auto l = result.lock(); 34 l.minLogLevel = level; 35 } 36 37 return result; 38 } 39 } 40