001/*
002MIT License
003
004Copyright (c) 2020 FBSQL Team
005
006Permission is hereby granted, free of charge, to any person obtaining a copy
007of this software and associated documentation files (the "Software"), to deal
008in the Software without restriction, including without limitation the rights
009to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
010copies of the Software, and to permit persons to whom the Software is
011furnished to do so, subject to the following conditions:
012
013The above copyright notice and this permission notice shall be included in all
014copies or substantial portions of the Software.
015
016THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
017IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
018FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
019AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
020LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
021OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
022SOFTWARE.
023
024Home:   https://fbsql.github.io
025E-Mail: fbsql.team@gmail.com
026*/
027
028package org.fbsql.servlet;
029
030import java.time.Instant;
031
032/**
033 * A simple logger is used for logging information about events
034 */
035public class Logger {
036        /**
037         * Severity
038         */
039        enum Severity {
040                INFO, //
041                WARN, //
042                ERROR, //
043                FATAL //
044        }
045
046        /**
047         * Logger message to standard system out
048         * Log record format: Date-time (in ISO 8601 format) + Severity + Message
049         * 
050         * @param severity - message severity
051         * @param message  - message body
052         */
053        static void out(Severity severity, String message) {
054                System.out.println(Instant.now().toString() + ' ' + severity.name() + ' ' + message);
055        }
056}
057
058/*
059Please contact FBSQL Team by E-Mail fbsql.team@gmail.com
060or visit https://fbsql.github.io if you need additional
061information or have any questions.
062*/
063
064/* EOF */