logapi.shlib revision 55a13001fbd9772352bc050632ef966a249dc73b
03831d35f7499c87d51205817c93e9a8d42c4baestevel# CDDL HEADER START
03831d35f7499c87d51205817c93e9a8d42c4baestevel# The contents of this file are subject to the terms of the
03831d35f7499c87d51205817c93e9a8d42c4baestevel# Common Development and Distribution License (the "License").
03831d35f7499c87d51205817c93e9a8d42c4baestevel# You may not use this file except in compliance with the License.
03831d35f7499c87d51205817c93e9a8d42c4baestevel# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
03831d35f7499c87d51205817c93e9a8d42c4baestevel# See the License for the specific language governing permissions
03831d35f7499c87d51205817c93e9a8d42c4baestevel# and limitations under the License.
03831d35f7499c87d51205817c93e9a8d42c4baestevel# When distributing Covered Code, include this CDDL HEADER in each
03831d35f7499c87d51205817c93e9a8d42c4baestevel# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
03831d35f7499c87d51205817c93e9a8d42c4baestevel# If applicable, add the following below this CDDL HEADER, with the
03831d35f7499c87d51205817c93e9a8d42c4baestevel# fields enclosed by brackets "[]" replaced with your own identifying
03831d35f7499c87d51205817c93e9a8d42c4baestevel# information: Portions Copyright [yyyy] [name of copyright owner]
03831d35f7499c87d51205817c93e9a8d42c4baestevel# CDDL HEADER END
03831d35f7499c87d51205817c93e9a8d42c4baestevel# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
03831d35f7499c87d51205817c93e9a8d42c4baestevel# Use is subject to license terms.
03831d35f7499c87d51205817c93e9a8d42c4baestevel# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
03831d35f7499c87d51205817c93e9a8d42c4baestevel# Output an assertion
03831d35f7499c87d51205817c93e9a8d42c4baestevel# $@ - assertion text
03831d35f7499c87d51205817c93e9a8d42c4baestevelfunction log_assert
03831d35f7499c87d51205817c93e9a8d42c4baestevel _printline ASSERTION: "$@"
03831d35f7499c87d51205817c93e9a8d42c4baestevel# Output a comment
03831d35f7499c87d51205817c93e9a8d42c4baestevel# $@ - comment text
03831d35f7499c87d51205817c93e9a8d42c4baestevelfunction log_note
03831d35f7499c87d51205817c93e9a8d42c4baestevel _printline NOTE: "$@"
typeset logfile="/tmp/log.$$"
out="/usr/bin/cat $logfile"
$out | /usr/bin/egrep -i "internal error|assertion failed" \
> /dev/null 2>&1
typeset logfile="/tmp/log.$$"
out="/usr/bin/cat $logfile"
$out | /usr/bin/egrep -i "internal error|assertion failed" \
> /dev/null 2>&1
typeset logfile="/tmp/log.$$"
/usr/bin/cat $logfile
/usr/bin/rm -f $logfile