LoggerUtils
LoggerUtils
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Methods summary
Modifier and Type | Method |
---|---|
public static array | tokenizeClassName ( string name ) |
public static | shortenClassName ( string name , integer length ) |
Methods in detail
-
tokenizeClassName
array public static tokenizeClassName ( string name )Splits a fully qualified class name into fragments delimited by the namespace separator (\). For backward compatibility, a dot (.) can be used as a delimiter as well.param
string namereturn
array -
shortenClassName
public static shortenClassName ( string name , integer length )Attempts to shorten the given class name to the desired length. This is done by separating the class name into fragments (delimited by \ or .) and trimming individual fragments, starting with the left, until desired length has been reached. The final fragment (i.e. class name) will never be shortened so the result may still be longer than given length.param
string name The (qualified) class name.integer length The length to shorten to. If null or 0 is given, the name will be returned without shortening.