77 */
88
99import { useEffect , useRef } from 'react'
10- import {
11- ALLOWED_NODE_ENVS ,
12- CSS_CHANGE ,
13- CSS_COMPONENT ,
14- CSS_SUB_VALUE ,
15- } from './constants'
1610import {
1711 UseLogConfig ,
1812 UseLogReturn ,
@@ -21,6 +15,12 @@ import {
2115 _PrintConfig ,
2216} from './types'
2317import { getComponentName , print } from './utils'
18+ import {
19+ ALLOWED_NODE_ENVS ,
20+ CSS_CHANGE ,
21+ CSS_COMPONENT ,
22+ CSS_SUB_VALUE ,
23+ } from './constants'
2424
2525/**
2626 * Provides a function to log through react component lifecycle.
@@ -42,6 +42,8 @@ export function useLog({
4242 subValueCSS = CSS_SUB_VALUE ,
4343 } = { } ,
4444 environments = ALLOWED_NODE_ENVS ,
45+ isGroupingEnabled = true ,
46+ isGroupCollapsed = false ,
4547} : UseLogConfig = { } ) : UseLogReturn {
4648 const componentName = getComponentName ( )
4749
@@ -63,7 +65,7 @@ export function useLog({
6365 const prevValueRef = useRef < T > ( )
6466 const printProps : Pick <
6567 _PrintConfig < T > ,
66- 'value' | 'styles' | 'componentName'
68+ 'value' | 'styles' | 'componentName' | 'flags'
6769 > = {
6870 value : clonedValue ,
6971 styles : {
@@ -72,6 +74,10 @@ export function useLog({
7274 changeCSS : props ?. styles ?. changeCSS ?? changeCSS ,
7375 } ,
7476 componentName,
77+ flags : {
78+ isGrouped : props ?. isGroupingEnabled ?? isGroupingEnabled ,
79+ isCollapsed : props ?. isGroupCollapsed ?? isGroupCollapsed ,
80+ } ,
7581 }
7682
7783 if ( environments . includes ( process . env . NODE_ENV ?? 'production' ) ) {
0 commit comments