001/* 002 * Logback: the reliable, generic, fast and flexible logging framework. 003 * Copyright (C) 1999-2026, QOS.ch. All rights reserved. 004 * 005 * This program and the accompanying materials are dual-licensed under 006 * either the terms of the Eclipse Public License v1.0 as published by 007 * the Eclipse Foundation 008 * 009 * or (per the licensee's choosing) 010 * 011 * under the terms of the GNU Lesser General Public License version 2.1 012 * as published by the Free Software Foundation. 013 */ 014 015package ch.qos.logback.core.util; 016 017import ch.qos.logback.core.CoreConstants; 018 019/** 020 * Utility class for retrieving version information of the "logback-core" module. 021 * 022 * @since 1.5.26 023 */ 024public class CoreVersionUtil { 025 /** 026 * Retrieves the version of the "logback-core" module using a properties file 027 * associated with the module. 028 * 029 * <p>The method locates and reads a properties file named "logback-core-version.properties" 030 * in the package of the {@code CoreConstants.class}. It then extracts the version 031 * information using the key "logback-core-version". 032 * </p> 033 * 034 * @return the version of the "logback-core" module as a string, or null if the version cannot be determined 035 * @since 1.5.26 036 */ 037 static public String getCoreVersionBySelfDeclaredProperties() { 038 return VersionUtil.getArtifactVersionBySelfDeclaredProperties(CoreConstants.class, "logback-core"); 039 } 040}