1 2 module geario.logging; 3 4 public import geario.logging.logger; 5 6 @safe: 7 8 /** 9 * Create loggers from config bundle 10 * 11 * Throws: BundleException, LogCreateException 12 */ 13 void createLogger(immutable string loggerName) 14 { 15 create(loggerName); 16 } 17 18 /** 19 * Get created logger interface to work with it 20 * 21 * Throws: LogException 22 */ 23 Logger getLogger(immutable string loggerName) 24 { 25 return get(loggerName); 26 } 27 28 /** 29 * Delete logger 30 * 31 * Throws: Exception 32 */ 33 void deleteLogger(immutable string loggerName) 34 { 35 remove(loggerName); 36 } 37 38 /** 39 * Check is Logger present 40 */ 41 bool isLogger(immutable string loggerName) nothrow 42 { 43 return isCreated(loggerName); 44 } 45 46 /** 47 * Set path to file for save loggers exception information 48 * 49 * Throws: Exception 50 */ 51 void setErrFile(immutable string file) 52 { 53 setErrorFile(file); 54 } 55 56 57 // unittest 58 // { 59 // createLogger("DebugLogger"); 60 // setErrorFile("./log/error.log"); 61 62 // auto log2 = getLogger("DebugLogger"); 63 // log2.trace("trace msg"); 64 // log2.info("info msg %d", 2); 65 // log2.error("error test %d %s", 3, "msg"); 66 // }