001/* 002 * This is free and unencumbered software released into the public domain. 003 * 004 * Please see https://github.com/binkley/binkley/blob/master/LICENSE.md. 005 */ 006 007package hm.binkley.util.logging.osi; 008 009import static hm.binkley.util.logging.LoggerUtil.refreshLogback; 010import static java.lang.System.clearProperty; 011import static java.lang.System.setProperty; 012import static org.slf4j.LoggerFactory.getLogger; 013 014/** 015 * {@code OSIMain} demonstrates OSI logging. 016 * 017 * @author <a href="mailto:binkley@alumni.rice.edu">B. K. Oxley (binkley)</a> 018 */ 019public final class OSIMain { 020 public static void main(final String... args) { 021 // This is the only configuration needed: 022 OSI.enable(); 023 024 getLogger("example").error("Hi, mom!"); 025 026 // Turn logging of logging on 027 setProperty("logback.debug", "true"); 028 refreshLogback(); 029 getLogger("example").error("Hi, mom!"); 030 031 // Turn it back off 032 clearProperty("logback.debug"); 033 refreshLogback(); 034 getLogger("example").error("Hi, mom!"); 035 } 036}